[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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