OFFSET
1,1
COMMENTS
For n=0 one has gcd(m+2, m+3) = 1 for any m.
See A255852 for the sequence including also even exponents, for which the GCD is > 1 already for m=1 (because gcd(1^2k+2, 2^2k+2) = gcd(3, 2^2k-1) = gcd(3, 4^k-1) = 3), and also for m=4 (because gcd(4^2k+2, 5^2k+2) = gcd(4^2k+2, (5^k-4^k)(5^k+4^k)) >= 3), etc.
a(21) = 3585, a(22) = 5, a(25) = 16, a(28) = 22, a(29) = 4495, a(31) = 1291, a(32) = 108, a(33) = 220, a(34) = 218039, a(35) = 2112. - Chai Wah Wu, May 08 2024
FORMULA
a(n) = A255852(2n+1).
MATHEMATICA
A255832[n_] := Module[{m = 1}, While[GCD[m^(2 n + 1) + 2, (m + 1)^(2 n + 1) + 2] <= 1, m++]; m]; Table[A255832[n], {n, 1, 10}] (* Robert Price, Oct 15 2018 *)
PROG
(PARI) a(n, c=2, L=10^6)={n=n*2+1; for(a=1, L, gcd(a^n+c, (a+1)^n+c)>1&&return(n))}
(Python)
from sympy import primefactors, resultant, nthroot_mod
from sympy.abc import x
def A255832(n):
k, t = 0, (n<<1)+1
for p in primefactors(resultant(x**t+2, (x+1)**t+2)):
for d in (a for a in nthroot_mod(-2, t, p, all_roots=True) if pow(a+1, t, p)==-2%p):
k = min(d, k) if k else d
return k # Chai Wah Wu, May 07 2024
CROSSREFS
KEYWORD
nonn,more,hard
AUTHOR
M. F. Hasler, Mar 08 2015
EXTENSIONS
a(12)-a(18) from Max Alekseyev, Aug 06 2015
STATUS
approved