A375065 Starting index of the first length-n (exactly) run of zeros in A374966.
0, 21, 1798, 429, 10727, 431795, 8394951, 171051143
Offset: 1
Programs
-
Mathematica
nn = 2^24; c[] := False; j = m = 0; r = 1; c[0] = True; s = Monitor[Reap[Do[If[c[n], k = 0; r++, k = j + n; If[j == 0, Sow[{r, n - r}]; If[r > m, m = r]; r = 0]]; Set[{c[k], j}, {True, k}], {n, nn}]][[-1, 1]], n]; TakeWhile[Array[s[[FirstPosition[s[[;; , 1]], #][[1]], -1]] &, m], IntegerQ] (* _Michael De Vlieger, Jul 29 2024 *)
-
Python
from itertools import count, islice def agen(): # generator of terms seen, an, zcount, zdict, zn = {0}, 0, 0, dict(), 1 for n in count(1): if an == 0: zcount += 1 else: if zcount not in zdict: zdict[zcount] = n-zcount-1 while zn in zdict: yield zdict[zn]; zn += 1 zcount = 0 an = 0 if n in seen else an + n seen.add(an) print(list(islice(agen(), 7))) # Michael S. Branicky, Jul 29 2024