%I #20 May 06 2016 13:59:42
%S 7,13,11,29,53,23,19,557,41,71,113,107,59,101,53,271,137,83,257,73,
%T 251,821,113,107,227,223,797,149,467,211,197,193,263,761,251,173,167,
%U 1601,233,227,397,719,293,383,379,701,1553,353,257,347,251,337,659,773,419,313,307,1493,1019,503,293
%N Smallest prime q > p such that q + p is a square, where p is the n-th prime.
%C Corresponding squares a(n)+prime(n): 9,16,16,36,64,36,36,576,64,100.
%C Also, a(n) >= A157480(n).
%H Zak Seidov, <a href="/A259232/b259232.txt">Table of n, a(n) for n = 1..10000</a>
%t Table[p=Prime[n];x=1+Floor[Sqrt[2*p]];While[!PrimeQ[q=x^2-p],x++];q,{n,100}]
%o (PARI) a(n)=p = prime(n); k = nextprime(p+1); while(!issquare(p+k), k = nextprime(k+1)); k; \\ _Michel Marcus_, Jun 22 2015
%o (PARI) a(n,p=prime(n))=my(s=sqrtint(2*p)); while(!isprime(s++^2-p),); s^2-p \\ _Charles R Greathouse IV_, May 06 2016
%Y Cf. A000040, A157480.
%K nonn
%O 1,1
%A _Zak Seidov_, Jun 22 2015