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.

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

Original entry on oeis.org

1, 0, 14, 320, 56, 675113, 224, 13, 5, 283, 33, 192, 26, 242, 5, 2, 10, 140, 5, 50, 142, 29, 18, 605962, 11, 97, 234881024, 951, 5, 3332537854, 14
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=0, gcd(k^0+7, (k+1)^0+7) = gcd(8, 8) = 8 for any k > 0, therefore a(0)=1 is the smallest possible positive value.
For n=1, gcd(k^n+7, (k+1)^n+7) = gcd(k+7, k+8) = 1, therefore a(1)=0.
For n=2, we have gcd(14^2+7, 15^2+7) = gcd(203, 232) = 29, and the pair (k,k+1)=(14,15) is the smallest which yields a gcd > 1, therefore a(2)=14.
		

Crossrefs

Programs

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

Extensions

a(26)-a(36) from Hiroaki Yamanouchi, Mar 12 2015