OFFSET
1,2
COMMENTS
EXAMPLE
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}]
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Michel Lagneau, Jan 05 2015
STATUS
approved