OFFSET
1,5
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..2000
EXAMPLE
a(6) = 5 because in A366585, the sixth run of same first digit of the terms lasts through five terms: 2021, 2223, 2425, 2627, 2829, each beginning with 2.
PROG
(PARI) lista(nn) = my(list=List(), k=1); while (k < nn, my(s="", n=digits(k)[1]); for (j=1, n, s = concat(s, Str(k+j-1)); ); listput(list, eval(s)); k += n; ); my(w = apply(x->digits(x)[1], list)); my(list=List(), last=w[1], nb=1); for (i=2, #w, if (w[i] == last, nb++, listput(list, nb); last=w[i]; nb=1; ); ); Vec(list, #list-1); \\ Michel Marcus, Oct 15 2023
(Python)
from itertools import islice
def A366610_gen(): # generator of terms
a, c = 1, 0
while (c:=c+1):
yield c
c, r = divmod((w:=((t:=int(str(a:=a+int(str(a)[0]))[0]))+1)*10**(len(str(a))-1)-1)-a, t)
a = w-r
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Tamas Sandor Nagy, Oct 14 2023
EXTENSIONS
More terms from Michel Marcus, Oct 15 2023
STATUS
approved