OFFSET
1,2
COMMENTS
a(n)=n if n^2+1 is prime and a(n)=1 if n is odd.
Conjecture: for all integer n, there exists at least an integer m <= n such that the smallest prime factor of n^2+1 is also the greatest prime factor of m^2+1. - Michel Lagneau, Sep 27 2015
LINKS
Michel Lagneau, Table of n, a(n) for n = 1..10000
EXAMPLE
a(34)=5 because the greatest prime divisor of 5^2+1 = 2*13 is the smallest prime divisor of 34^2+1 =13*89.
MAPLE
with(numtheory):nn:=2000:T:=array(1..nn):U:=array(1..nn):
for i from 1 to nn do:
x:=factorset(i^2+1):T[i]:=x[1]:U[i]:=i:
od:
for n from 1 to 100 do:
ii:=0:
for k from 1 to 50000 while(ii=0) do:
y:=factorset(k^2+1):n0:=nops(y):q:=y[n0]:
if q=T[n]
then
ii:=1: printf(`%d, `, k):
else
fi:
od:
od:
MATHEMATICA
Table[k = 1; While[FactorInteger[k^2 + 1][[-1, 1]] != FactorInteger[n^2 + 1][[1, 1]], k++]; k, {n, 82}] (* Michael De Vlieger, Sep 27 2015 *)
PROG
(PARI) a(n) = {f = factor(n^2+1)[1, 1]; k = 1; while (! ((g=factor(k^2+1)) && (g[#g~, 1] == f)), k++); k; } \\ Michel Marcus, Sep 14 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Sep 14 2014
STATUS
approved