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.

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

This page as a plain text file.
%I A255856 #27 May 09 2024 10:59:09
%S A255856 1,0,2,1,48,9,1,19,14,1,2,77364635,1,1943,2,1,5,299788383228819788,1,
%T A255856 1578270389554680057141787800241971645032008710129107338825798,9,1,2,
%U A255856 6676,1,415,2,1,39,168338080349,1,305,6806,1,2,9,1
%N A255856 Least k > 0 such that gcd(k^n+6, (k+1)^n+6) > 1, or 0 if there is no such k.
%C A255856 See A118119, which is the main entry for this class of sequences.
%F A255856 a(3k)=1 for k>=0, because gcd(1^(3k)+6, 2^(3k)+6) = gcd(7, 8^k-1) = 7.
%e A255856 For n=1, gcd(k^n+6, (k+1)^n+6) = gcd(k+6, k+7) = 1, therefore a(1)=0.
%e A255856 For n=2, we have gcd(2^2+6, 3^2+6) = gcd(10, 15) = 5, and the pair (k,k+1)=(2,3) is the smallest which yields a gcd > 1, therefore a(2)=2.
%e A255856 For n=3k, see formula.
%t A255856 A255856[n_] := Module[{m = 1}, While[GCD[m^n + 6, (m + 1)^n + 6] <= 1, m++]; m]; Join[{1, 0}, Table[A255856[n], {n, 2, 10}]] (* _Robert Price_, Oct 15 2018 *)
%o A255856 (PARI) a(n,c=6,L=10^7,S=1)={n!=1&&for(a=S,L,gcd(a^n+c,(a+1)^n+c)>1&&return(a))}
%o A255856 (Python)
%o A255856 from sympy import primefactors, resultant, nthroot_mod
%o A255856 from sympy.abc import x
%o A255856 def A255856(n):
%o A255856     if n == 0: return 1
%o A255856     k = 0
%o A255856     for p in primefactors(resultant(x**n+6,(x+1)**n+6)):
%o A255856         for d in (a for a in sorted(nthroot_mod(-6,n,p,all_roots=True)) if pow(a+1,n,p)==-6%p):
%o A255856             k = min(d,k) if k else d
%o A255856             break
%o A255856     return int(k) # _Chai Wah Wu_, May 09 2024
%Y A255856 Cf. A118119, A255832, A255852-A255869
%K A255856 nonn,hard,more
%O A255856 0,3
%A A255856 _M. F. Hasler_, Mar 08 2015
%E A255856 a(11)-a(36) from _Hiroaki Yamanouchi_, Mar 13 2015