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.

A255855 Least k > 0 such that gcd(k^n+5, (k+1)^n+5) > 1, or 0 if there is no such k.

Original entry on oeis.org

1, 0, 1, 5, 1, 533360, 1, 55, 1, 7, 1, 796479131355665831357, 1, 41, 1, 5, 1, 3775, 1, 42296, 1, 7, 1, 653246700175064613889, 1, 21, 1, 5, 1, 1619, 1, 42842, 1, 7, 1, 2945, 1, 323371, 1, 5, 1, 1102221, 1, 633524110177, 1, 7, 1
Offset: 0

Views

Author

M. F. Hasler, Mar 08 2015

Keywords

Comments

See A118119, which is the main entry for this class of sequences.

Examples

			For n=1, gcd(k^n+5, (k+1)^n+5) = gcd(k+5, k+6) = 1, therefore a(1)=0.
For n=2k, see formula.
For n=3, we have gcd(5^3+5, 6^3+5) = 13, and the pair (k,k+1)=(5,6) is the smallest which yields a GCD > 1, therefore a(3)=5.
		

Crossrefs

Programs

  • Mathematica
    A255855[n_] := Module[{m = 1}, While[GCD[m^n + 5, (m + 1)^n + 5] <= 1, m++]; m]; Join[{1, 0}, Table[A255855[n], {n, 2, 10}]]
  • PARI
    a(n,c=5,L=10^7,S=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 x
    def A255855(n):
        if n == 0: return 1
        k = 0
        for p in primefactors(resultant(x**n+5,(x+1)**n+5)):
            for d in (a for a in sorted(nthroot_mod(-5,n,p,all_roots=True)) if pow(a+1,n,p)==-5%p):
                k = min(d,k) if k else d
                break
        return int(k) # Chai Wah Wu, May 08 2024

Formula

a(2k)=1 for k>=0, because gcd(1^(2k)+5,2^(2k)+5) = gcd(6,4^k-1) = 3.

Extensions

a(11)-a(46) from Hiroaki Yamanouchi, Mar 12 2015