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.

A255832 Least m > 0 such that gcd(m^(2n+1)+2, (m+1)^(2n+1)+2) > 1.

Original entry on oeis.org

51, 40333, 434, 16, 1234, 78607, 8310, 817172, 473, 116, 22650, 736546059, 22, 1080982, 252, 7809, 644, 1786225573
Offset: 1

Views

Author

M. F. Hasler, Mar 08 2015

Keywords

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

Crossrefs

Cf. A118119, A255853, A255853, ... for other variants, corresponding to different constant offsets (+1, +3, ...) in the arguments of gcd.

Programs

  • 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 *)
  • 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

Formula

a(n) = A255852(2n+1).

Extensions

a(12)-a(18) from Max Alekseyev, Aug 06 2015