A253596 Numbers k such that A002313(m) is the greatest prime divisor of k^2 + 1 and A002313(m+1) is the greatest prime divisor of (k+1)^2 + 1 for some m.
1, 7, 31, 293, 1936, 2244, 4158, 5744, 11573, 25242, 285202, 339354
Offset: 1
Examples
31 is in the sequence because 31^2 + 1 = 2*13*37 and 32^2 + 1 = 5*5*41 with the property that 37 = A002313(6) and 41 = A002313(7).
Programs
-
Maple
with(numtheory): nn:=500000:print(1): for n from 1 to nn do: p:=n^2+1:x:=factorset(p):n0:=nops(x):p1:=x[n0]: q:=(n+1)^2+1:y:=factorset(q):n1:=nops(y):p2:=y[n1]:ii:=0: for j from 2 by 2 to 1000 while(ii=0) do: pp:=p1+j: if type(pp,prime)=true and irem(pp,4)=1 then p3:=pp:ii:=1: else fi: od: if p3=p2 then print(n): else fi: od:
-
Mathematica
lst={};Do[If[Mod[Prime[i],4]==1||Mod[Prime[i],4]==2,AppendTo[lst,Prime[i]]],{i,1,1000}];Do[Do[If[FactorInteger[n^2+1][[-1]][[1]]==Part[lst,j]&&FactorInteger[(n+1)^2+1][[-1]][[1]]==Part[lst,j+1],Print[n]],{n,1,20000}],{j,1,999}]
Comments