OFFSET
0,4
COMMENTS
See A118119, which is the main entry for this class of sequences.
FORMULA
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).
EXAMPLE
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.
For n=1, gcd(m^n+17, (m+1)^n+17) = gcd(m+17, m+18) = 1, therefore a(1)=0.
For n=2, see formula with k=0.
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.
MAPLE
f:= proc(n) local q1, q2, r, m, bestm, p, A;
q1:= m^n + 17;
q2:= (m+1)^n + 17;
r:= resultant(q1, q2, m);
bestm:= infinity;
for p in numtheory:-factorset(r) do
A:= [msolve(q1, p)];
A:= select(s -> eval(q2, s) mod p = 0, A);
bestm:= min(bestm, op(map(s -> subs(s, m), A)));
od;
if bestm = infinity then -1 else bestm fi
end proc:
f(0):= 1: f(1):=0:
map(f, [$1..26]); # Robert Israel, May 31 2019
MATHEMATICA
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 *)
PROG
(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))}
(Python)
from sympy import primefactors, resultant, nthroot_mod
from sympy.abc import m
def A255867(n):
if n == 0: return 1
k = 0
for p in primefactors(resultant(m**n+17, (m+1)**n+17)):
for d in (a for a in nthroot_mod(-17, n, p, all_roots=True) if pow(a+1, n, p)==-17%p):
k = min(d, k) if k else d
return k # Chai Wah Wu, May 07 2024
CROSSREFS
KEYWORD
nonn,hard
AUTHOR
M. F. Hasler, Mar 09 2015
EXTENSIONS
a(5)-a(22) from Hiroaki Yamanouchi, Mar 12 2015
a(23)-a(60) from Max Alekseyev, Aug 06 2015
STATUS
approved