cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A372075 a(1) = 1; thereafter a(n+1) is obtained by prepending the digit-sum of a(n) to a(n).

Original entry on oeis.org

1, 11, 211, 4211, 84211, 1684211, 231684211, 28231684211, 3828231684211, 493828231684211, 62493828231684211, 7062493828231684211, 777062493828231684211, 91777062493828231684211, 10191777062493828231684211, 10310191777062493828231684211
Offset: 1

Views

Author

N. J. A. Sloane, Jun 16 2024

Keywords

Examples

			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
		

Crossrefs

Programs

  • Mathematica
    NestList[DigitSum[#]*10^IntegerLength[#] + # &, 1, 20] (* Paolo Xausa, Jun 16 2024 *)
  • 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
Showing 1-1 of 1 results.