OFFSET
1,1
COMMENTS
Or, k such that k/2 +- 1 and (k^2)/2 +- 1 are primes. Hence all k's are multiples of 12.
LINKS
Zak Seidov and Harvey P. Dale, Table of n, a(n) for n = 1..1000 (first 430 terms from Zak Seidov)
EXAMPLE
12 = 5 + 7, 12^2 = 144 = 71 + 73.
MATHEMATICA
Reap[ Do[ If[ And @@ PrimeQ /@ {n/2-1, n/2+1, n^2/2-1, n^2/2+1}, Sow[n]], {n, 12, 263556, 12}]][[2, 1]] (* Jean-François Alcover, Jul 17 2012 *)
tppQ[n_]:=And@@PrimeQ[n/2+{1, -1}]&&And@@PrimeQ[n^2/2+{1, -1}]; Select[ Range[ 12, 300000, 12], tppQ] (* Harvey P. Dale, Dec 20 2012 *)
Select[12*Range[22000], AllTrue[Flatten[{#/2+{1, -1}, #^2/2+{1, -1}}], PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 07 2015 *)
PROG
(PARI) is(n)=if(n%12, return(0)); isprime(n/2-1) && isprime(n/2+1) && isprime(n^2/2-1) && isprime(n^2/2+1) \\ Charles R Greathouse IV, Jul 31 2016
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Zak Seidov, Jun 19 2012
STATUS
approved