

A157480


a(n) = least prime p such that p + prime(n) is a square.


5



2, 13, 11, 2, 5, 3, 19, 17, 2, 7, 5, 107, 23, 101, 2, 11, 5, 3, 257, 29, 71, 2, 17, 11, 3, 43, 41, 37, 467, 31, 17, 13, 7, 5, 47, 173, 167, 1601, 2, 23, 17, 719, 5, 3, 59, 701, 113, 2, 29, 347, 23, 17, 83, 5, 67, 61, 131, 53, 47, 43, 41, 31, 17, 13, 11, 7, 569, 239, 53, 227, 47, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


LINKS



EXAMPLE

The difference between prime 3 and the square 16 is 13 which is prime and in the sequence.


MATHEMATICA

Table[p=Prime[n]; b=Ceiling[Sqrt[p]]; While[!PrimeQ[x=b^2p], b++]; x, {n, 72}]


PROG

(PARI) g(n)= c=0; forprime(x=2, n, for(k=1, n^2, if(issquare(x+k)&&isprime(k),
print1(k", "); c++; break))); c


CROSSREFS



KEYWORD

nonn


AUTHOR



EXTENSIONS

Better definition and Mma program from Zak Seidov, Mar 14 2013


STATUS

approved



