login
A372075
a(1) = 1; thereafter a(n+1) is obtained by prepending the digit-sum of a(n) to a(n).
2
1, 11, 211, 4211, 84211, 1684211, 231684211, 28231684211, 3828231684211, 493828231684211, 62493828231684211, 7062493828231684211, 777062493828231684211, 91777062493828231684211, 10191777062493828231684211, 10310191777062493828231684211
OFFSET
1,2
LINKS
EXAMPLE
a(4) = 4211 as a(3) = 211 which has digital sum 2 + 1 + 1 = 4. Concatenating 4 and 211 gives 4211. - David A. Corneth, Jun 16 2024
MATHEMATICA
NestList[DigitSum[#]*10^IntegerLength[#] + # &, 1, 20] (* Paolo Xausa, Jun 16 2024 *)
PROG
(PARI) first(n) = {
my(res = vector(n));
res[1] = 1;
for(i = 2, n,
res[i] = sumdigits(res[i-1])*10^(#digits(res[i-1]))+res[i-1]
); res
} \\ David A. Corneth, Jun 16 2024
(Python)
from itertools import islice
def A372075_gen(): # generator of terms
yield (a:=1)
while True: yield (a:=a+10**len(s:=str(a))*sum(map(int, s)))
A372075_list = list(islice(A372075_gen(), 20)) # Chai Wah Wu, Jun 16 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jun 16 2024
STATUS
approved