login
A366610
Number of successive occurrences of the same first digits in A366585.
2
1, 1, 1, 1, 4, 5, 4, 2, 2, 2, 2, 1, 1, 97, 50, 34, 25, 20, 17, 14, 13, 11, 995, 500, 334, 250, 200, 167, 143, 125, 111, 9996, 5000, 3334, 2500, 2000, 1667, 1428, 1250, 1112, 99992, 50000, 33334, 25000, 20000, 16667, 14286, 12500, 11111, 999995, 500000, 333334, 250000, 200000, 166667, 142857
OFFSET
1,5
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
A366610_list = list(islice(A366610_gen(), 30)) # Chai Wah Wu, Nov 04 2023
CROSSREFS
Cf. A366585.
Sequence in context: A092141 A120867 A011427 * A175622 A071413 A161811
KEYWORD
nonn,base
AUTHOR
Tamas Sandor Nagy, Oct 14 2023
EXTENSIONS
More terms from Michel Marcus, Oct 15 2023
STATUS
approved