A217583 Numbers n^2+1 such that (n-1)^2+1 and (n+1)^2+1 are prime.
10, 26, 226, 626, 3026, 15626, 42026, 148226, 216226, 403226, 416026, 511226, 1199026, 1311026, 1380626, 1550026, 1625626, 1729226, 1890626, 2449226, 2608226, 2805626, 2839226, 3861226, 4223026, 4347226, 4389026, 5784026, 6027026, 6426226, 7102226, 8037226
Offset: 1
Keywords
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Maple
with(numtheory):for n from 1 to 500 do: x1:=n^2+1:x2:=(n+2)^2 + 1:if type(x1,prime)=true and type(x2,prime)=true then printf(`%d, `,(n+1)^2+1):else fi:od:
-
Mathematica
Select[Partition[Range[3000]^2+1,3,1],AllTrue[{#[[1]],#[[3]]},PrimeQ]&][[All,2]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 03 2019 *)
-
PARI
forstep(n=3,1e3,2,if(isprime(n^2+2*n+2) && isprime(n^2-2*n+2), print1(n^2+1", "))) \\ Charles R Greathouse IV, Oct 09 2012