cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A255867 Least m > 0 such that gcd(m^n+17, (m+1)^n+17) > 1, or 0 if there is no such m.

This page as a plain text file.
%I A255867 #29 May 08 2024 02:28:22
%S A255867 1,0,1,1925,1,189812175,1,2,1,116,1,55508752881180794569675021,1,
%T A255867 337276,1,230,1,162,1,2628,1,15,1,3604979675443168377172749,1,53,1,
%U A255867 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 A255867 Least m > 0 such that gcd(m^n+17, (m+1)^n+17) > 1, or 0 if there is no such m.
%C A255867 See A118119, which is the main entry for this class of sequences.
%F A255867 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 A255867 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 A255867 For n=1, gcd(m^n+17, (m+1)^n+17) = gcd(m+17, m+18) = 1, therefore a(1)=0.
%e A255867 For n=2, see formula with k=0.
%e A255867 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 A255867 f:= proc(n) local q1, q2, r, m, bestm,p,A;
%p A255867   q1:= m^n + 17;
%p A255867   q2:= (m+1)^n + 17;
%p A255867   r:= resultant(q1,q2, m);
%p A255867   bestm:= infinity;
%p A255867   for p in numtheory:-factorset(r) do
%p A255867     A:= [msolve(q1, p)];
%p A255867     A:= select(s -> eval(q2, s) mod p = 0, A);
%p A255867     bestm:= min(bestm, op(map(s -> subs(s,m), A)));
%p A255867   od;
%p A255867   if bestm = infinity then -1 else bestm fi
%p A255867 end proc:
%p A255867 f(0):= 1: f(1):=0:
%p A255867 map(f, [$1..26]); # _Robert Israel_, May 31 2019
%t A255867 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 A255867 (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 A255867 (Python)
%o A255867 from sympy import primefactors, resultant, nthroot_mod
%o A255867 from sympy.abc import m
%o A255867 def A255867(n):
%o A255867     if n == 0: return 1
%o A255867     k = 0
%o A255867     for p in primefactors(resultant(m**n+17,(m+1)**n+17)):
%o A255867         for d in (a for a in nthroot_mod(-17,n,p,all_roots=True) if pow(a+1,n,p)==-17%p):
%o A255867             k = min(d,k) if k else d
%o A255867     return k  # _Chai Wah Wu_, May 07 2024
%Y A255867 Cf. A118119, A255832, A255852-A255869
%K A255867 nonn,hard
%O A255867 0,4
%A A255867 _M. F. Hasler_, Mar 09 2015
%E A255867 a(5)-a(22) from _Hiroaki Yamanouchi_, Mar 12 2015
%E A255867 a(23)-a(60) from _Max Alekseyev_, Aug 06 2015