OFFSET
1,1
LINKS
Zak Seidov, Table of n, a(n) for n = 1..1200
EXAMPLE
Sequence contains the prime 3 because 3+5+1 = 3^2, the prime 5 because 11+13+1 = 5^2, the prime 11 because 59+61+1 = 11^2, the prime 17 because 139+149+1 = 17^2, etc.
MAPLE
seq( ifactor(ithprime(x)+ithprime(x+1)+1), x=1..20); # check squares of primes
MATHEMATICA
f[n_] := Block[{k = Prime[n] + Prime[n + 1] + 1}, If[IntegerQ[ Sqrt[k]], k, 0]]; Select[ Sqrt[ f[ # ]] & /@ Select[ Range[10000], f[ # ] != 0 &], PrimeQ[ # ] &] (* Robert G. Wilson v, Apr 15 2004 *)
tspQ[n_]:=Module[{c=n^2-1}, NextPrime[c/2]+NextPrime[c/2, -1]==c]; Select[ Prime[ Range[250]], tspQ] (* Harvey P. Dale, Apr 30 2019 *)
PROG
(PARI) is(n) = precprime((n-1)/2)+nextprime(n/2) == n; \\ A001043
isok(p) = isprime(p) && is(p^2-1); \\ Michel Marcus, Mar 16 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Jorge Coveiro, Apr 12 2004
EXTENSIONS
Edited by Robert G. Wilson v and Don Reble, Apr 15 2004
STATUS
approved