A217448 Least k > 0 such that 1 + n^2 and 1 + (n+k)^2 have the same smallest prime factor.
2, 6, 2, 26, 2, 74, 2, 4, 2, 404, 2, 6, 2, 366, 2, 514, 2, 4, 2, 1564, 2, 6, 2, 1106, 2, 4010, 2, 4, 2, 34, 2, 6, 2, 10, 2, 2594, 2, 4, 2, 22334, 2, 6, 2, 16, 2, 58, 2, 4, 2, 64, 2, 6, 2, 29062, 2, 18710, 2, 4, 2, 10, 2, 6, 2, 42, 2, 17428, 2, 4, 2, 16, 2, 6
Offset: 1
Examples
a(10) = 404 because 10^2 + 1 = 101, (10+404)^2+1 = 101*1697 so A089120(10) = A089120(414) = 101; a(170) = 404274 because 170^2 + 1 = 28901, (170+404274)^2+1 = 163574949137 = 28901* 5659837 so A089120(170) = A089120(40444) = 28901.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Programs
-
Maple
with(numtheory):T:=array(1..100): for n from 1 to 100 do:x:=factorset(n^2+1):n1:=nops(x): T[n] := x[1]:od:for a from 1 to 80 do:p:=T[a]:ii:=0:for k from 1 to 50000 while(ii=0) do: z:=factorset((a+k)^2+1): n2:=nops(z):if z[1]=p then printf(`%d, `,k):ii:=1:else fi:od:od:
-
Mathematica
sspf[n_]:=Module[{c=FactorInteger[1+n^2][[1,1]],k=1},While[ FactorInteger[ 1+ (n+k)^2][[1,1]]!=c,k++];k]; Array[sspf,80] (* Harvey P. Dale, Oct 12 2012 *)
-
PARI
A020639(n) = if(1==n, n, factor(n)[1, 1]); A217448(n) = { my(spf=A020639(1+(n^2)), x); for(k=1,oo,x=1+((n+k)^2); if(!(x%spf) && A020639(x)==spf,return(k))); }; \\ Antti Karttunen, May 24 2021
Comments