reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
Robert Israel, <a href="/A341599/b341599.txt">Table of n, a(n) for n = 1..10000</a>
approved
editing
proposed
approved
editing
proposed
isprime(n + 2*add(`if`(isprime(n+i) and isprime(n-i), i, 0), i=26..n-5, 6) + `if`(isprime(2, *n - 3), 2*n-6, 0))
allocated for Robert IsraelPrimes p such that p + 2*Sum({k > 0 : p+k and p-k are both prime}) is prime.
2, 3, 19, 29, 47, 59, 61, 73, 103, 109, 149, 173, 179, 199, 227, 271, 379, 383, 463, 467, 479, 499, 509, 541, 557, 593, 607, 673, 733, 761, 829, 947, 953, 1019, 1049, 1061, 1063, 1109, 1259, 1307, 1319, 1373, 1399, 1489, 1607, 1699, 1709, 1721, 1723, 1741, 1801, 1889, 1931, 1979, 1987, 2029, 2039
1,1
a(4) = 29 is a term because the values of k for which 29+k and 29-k are prime are 12, 18 and 24, and 19+2*(12+18+24) = 127 which is prime.
filter:= proc(n) local i;
isprime(n + 2*add(`if`(isprime(n+i) and isprime(n-i), i, 0), i=2..n-2, 2))
end proc:
select(filter, [seq(ithprime(i), i=1..1000)]);
allocated
nonn
J. M. Bergot and Robert Israel, Feb 15 2021
approved
editing
allocated for Robert Israel
allocated
approved