%I #18 Jul 13 2024 17:30:58
%S 2,9,15,28,40,41,42,48,60,68,79,83,93,95,98,100,108,114,118,120,124,
%T 129,132,137,147,149,167,196,202,206,207,215,219,221,223,225,230,243,
%U 248,255,261,265,274,276,287,299,302,320,323,329,337,341,353,356,360,364,365,373,380,381,391,405,410
%N Numbers k such that A125611(k) = A125611(k + 1).
%C Numbers k such that A125611(k)^6 - 1 is divisible by 7^(k+1).
%C Since the 3 consecutive numbers 40, 41 and 42 are in the sequence, A125611(40) = A125611(41) = A125611(42) = A125611(43).
%H Robert Israel, <a href="/A369154/b369154.txt">Table of n, a(n) for n = 1..430</a>
%e a(3) = 15 is a term because A125611(15) = A125611(16) = 56020344873707, i.e., 56020344873707 is the least prime p such that p^6 - 1 is divisible by 7^15, and in this case p^6 - 1 is also divisible by 7^16.
%p f:= proc(n) local R,r,i;
%p R:= sort(map(rhs@op, [msolve(x^6=1, 7^n)]));
%p for i from 0 do
%p for r in R do
%p if isprime(7^n * i + r) then return 7^n * i + r fi
%p od od;
%p end proc:
%p R:= NULL: count:= 0:
%p for k from 1 while count < 100 do
%p v:= f(k);
%p if v = w then R:= R, k-1; count:= count+1 fi;
%p w:= v;
%p od:
%p R;
%o (Python)
%o from itertools import count, islice
%o from sympy import nthroot_mod, isprime
%o def A369154_gen(): # generator of terms
%o c, m = 1, 1
%o for k in count(0):
%o m *= 7
%o r = sorted(nthroot_mod(1,6,m,all_roots=True))
%o for i in count(0,m):
%o for p in r:
%o if isprime(i+p):
%o if i+p == c:
%o yield k
%o c = i+p
%o break
%o else:
%o continue
%o break
%o A369154_list = list(islice(A369154_gen(),30)) # _Chai Wah Wu_, May 04 2024
%Y Cf. A125611.
%K nonn
%O 1,1
%A _Robert Israel_, Jan 14 2024