A247339 a(n) is the least number k such that the greatest prime divisor of k^2+1 is the smallest prime divisor of n^2+1.
1, 2, 1, 4, 1, 6, 1, 2, 1, 10, 1, 2, 1, 14, 1, 16, 1, 2, 1, 20, 1, 2, 1, 24, 1, 26, 1, 2, 1, 4, 1, 2, 1, 5, 1, 36, 1, 2, 1, 40, 1, 2, 1, 5, 1, 12, 1, 2, 1, 9, 1, 2, 1, 54, 1, 56, 1, 2, 1, 5, 1, 2, 1, 4, 1, 66, 1, 2, 1, 5, 1, 2, 1, 74, 1, 23, 1, 2, 1, 6, 1, 2
Offset: 1
Keywords
Examples
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.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
-
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
Comments