Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #29 May 08 2024 02:28:22
%S 1,0,1,1925,1,189812175,1,2,1,116,1,55508752881180794569675021,1,
%T 337276,1,230,1,162,1,2628,1,15,1,3604979675443168377172749,1,53,1,
%U 248,1,254,1,5998484614,1,1323,1,2,1,42750021,1,51,1,17870,1,108,1,87,1,8274,1,2,1,35,1,4049,1,308,1,8885,1,2805086,1
%N Least m > 0 such that gcd(m^n+17, (m+1)^n+17) > 1, or 0 if there is no such m.
%C See A118119, which is the main entry for this class of sequences.
%F a(2k) = 1 for k>=0, because gcd(1^(2k)+17, 2^(2k)+17) = gcd(18, 4^k-1) >= 3 since 4 = 1 (mod 3).
%e For n=0, gcd(m^0+17, (m+1)^0+17) = gcd(18, 18) = 18, therefore a(0)=1, the smallest possible (positive) m-value.
%e For n=1, gcd(m^n+17, (m+1)^n+17) = gcd(m+17, m+18) = 1, therefore a(1)=0.
%e For n=2, see formula with k=0.
%e For n=3, gcd(1925^3+17, 1926^3+17) = 1951 and (m, m+1) = (1925, 1926) is the smallest pair which yields a GCD > 1 here.
%p f:= proc(n) local q1, q2, r, m, bestm,p,A;
%p q1:= m^n + 17;
%p q2:= (m+1)^n + 17;
%p r:= resultant(q1,q2, m);
%p bestm:= infinity;
%p for p in numtheory:-factorset(r) do
%p A:= [msolve(q1, p)];
%p A:= select(s -> eval(q2, s) mod p = 0, A);
%p bestm:= min(bestm, op(map(s -> subs(s,m), A)));
%p od;
%p if bestm = infinity then -1 else bestm fi
%p end proc:
%p f(0):= 1: f(1):=0:
%p map(f, [$1..26]); # _Robert Israel_, May 31 2019
%t A255867[n_] := Module[{m = 1}, While[GCD[m^n + 17, (m + 1)^n + 17] <= 1, m++]; m]; Join[{1, 0}, Table[A255867[n], {n, 2, 10}]] (* _Robert Price_, Oct 16 2018 *)
%o (PARI) a(n,c=17,L=10^7,S=1)={n!=1 && for(a=S,L,gcd(a^n+c,(a+1)^n+c)>1 && return(a))}
%o (Python)
%o from sympy import primefactors, resultant, nthroot_mod
%o from sympy.abc import m
%o def A255867(n):
%o if n == 0: return 1
%o k = 0
%o for p in primefactors(resultant(m**n+17,(m+1)**n+17)):
%o for d in (a for a in nthroot_mod(-17,n,p,all_roots=True) if pow(a+1,n,p)==-17%p):
%o k = min(d,k) if k else d
%o return k # _Chai Wah Wu_, May 07 2024
%Y Cf. A118119, A255832, A255852-A255869
%K nonn,hard
%O 0,4
%A _M. F. Hasler_, Mar 09 2015
%E a(5)-a(22) from _Hiroaki Yamanouchi_, Mar 12 2015
%E a(23)-a(60) from _Max Alekseyev_, Aug 06 2015