login
Least k > 0 such that 1 + n^2 and 1 + (n+k)^2 have the same smallest prime factor.
1

%I #25 May 26 2021 08:32:11

%S 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,

%T 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,

%U 29062,2,18710,2,4,2,10,2,6,2,42,2,17428,2,4,2,16,2,6

%N Least k > 0 such that 1 + n^2 and 1 + (n+k)^2 have the same smallest prime factor.

%C Alternate title: Least k > 0 such that A089120(n) = A089120(n+k).

%C A089120(n): smallest prime factor of n^2 + 1.

%C Conjecture: a(n) exists for all n.

%H Antti Karttunen, <a href="/A217448/b217448.txt">Table of n, a(n) for n = 1..10000</a>

%e a(10) = 404 because 10^2 + 1 = 101, (10+404)^2+1 = 101*1697 so A089120(10) = A089120(414) = 101;

%e a(170) = 404274 because 170^2 + 1 = 28901, (170+404274)^2+1 = 163574949137 = 28901* 5659837 so A089120(170) = A089120(40444) = 28901.

%p 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:

%t 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 *)

%o (PARI)

%o A020639(n) = if(1==n, n, factor(n)[1, 1]);

%o 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

%Y Cf. A089120, A217393, A014442.

%K nonn,look

%O 1,1

%A _Michel Lagneau_, Oct 03 2012