%I #29 Oct 15 2018 22:08:11
%S 1,0,1,5,1,5238149,1,24747,1,5,1,1042068640211853141849723,1,28913777,
%T 1,5,1,9380,1,87940,1,5,1,677083547,1,1584,1,5,1,5355,1,257,1,5,1,118,
%U 1,3250,1,5,1,78609080,1,1807714890,1,5,1
%N Least k > 0 such that gcd(k^n + 8, (k+1)^n + 8) > 1, or 0 if there is no such k.
%C See A118119, which is the main entry for this class of sequences.
%F a(2k)=1 for k >= 0, because gcd(1^(2k) + 8, 2^(2k) + 8) = gcd(9, 4^k-1) >= 3.
%e For n=1, gcd(k^n + 8, (k+1)^n + 8) = gcd(k+8, k+9) = 1, therefore a(1)=0.
%e For n=2*k, see formula.
%e For n=3, we have gcd(5^3 + 8, 6^3 + 8) = gcd(133, 224) = 7, and the pair (k,k+1)=(5,6) is the smallest which yields a GCD > 1, therefore a(3)=5.
%t A255858[n_] := Module[{m = 1}, While[GCD[m^n + 8, (m + 1)^n + 8] <= 1, m++]; m]; Join[{1, 0}, Table[A255858[n], {n, 2, 10}]] (* _Robert Price_, Oct 15 2018 *)
%o (PARI) a(n,c=8,L=10^7,S=1)={n!=1&&for(a=S,L,gcd(a^n+c,(a+1)^n+c)>1&&return(a))}
%Y Cf. A118119, A255832, A255852-A255869.
%K nonn,hard
%O 0,4
%A _M. F. Hasler_, Mar 08 2015
%E a(11)-a(40) from _Hiroaki Yamanouchi_, Mar 13 2015
%E a(41)-a(46) from _Max Alekseyev_, Aug 06 2015
|