A218047 Numbers n such that n^2+1, (n+2)^2+1, (n+6)^2+1, (n+10)^2+1 and (n+12)^2+1 are prime.
4, 14, 31464, 37684, 65664, 202034, 287414, 300174, 430044, 630734, 791834, 809244, 885274, 1230334, 1347834, 1411654, 1424674, 1475744, 1635134, 1721844, 1914514, 2391364, 2536414, 2855194, 3151704, 3386994, 3421844, 4010614, 4121494, 4186664, 4566484
Offset: 1
Keywords
Examples
4 is in the sequence because 4^2+1 = 5; 6^2+1 = 37; 10^2+1 = 101; 14^2+1 = 197 and 16^2+1 = 257 are prime.
Programs
-
Maple
with(numtheory):f:=n->n^2+1: for n from 1 to 460000 do:if type(f(n),prime) and type(f(n+2),prime) and type(f(n+6),prime) and type(f(n+10),prime) and type(f(n+12),prime) then printf(`%d, `,n):else fi:od:
-
Mathematica
lst={}; Do[p1=n^2+1; p2=(n+2)^2+1; p3=(n+6)^2+1; p4=(n+10)^2+1; p5=(n+12)^2+1;If[PrimeQ[p1] && PrimeQ[p2] && PrimeQ[p3] && PrimeQ[p4]&& PrimeQ[p5], AppendTo[lst, n]], {n, 0, 460000}];lst Select[Range[457*10^4],AllTrue[(#+{0,2,6,10,12})^2+1,PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 30 2019 *)
-
PARI
is_A218047(n,d=[0,2,6,10,12])=!for(i=1,#d,isprime(1+(n+d[i])^2) || return) forstep(n=4,9e9,10,is_A218047(n) & print1(n",")) \\ M. F. Hasler, Oct 21 2012
Extensions
Given terms a(1..31) double checked by M. F. Hasler, Oct 21 2012
Comments