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.

A378782 a(1) = 1. For n > 1, a(n) is the number of terms a(i), 1 <= i <= n-1 where the sum of the digits of a(i) is <= sum of digits of a(n-1).

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 6, 10, 4, 9, 16, 14, 11, 6, 15, 16, 19, 23, 13, 11, 7, 23, 16, 25, 26, 28, 32, 17, 30, 10, 5, 20, 9, 37, 40, 16, 33, 27, 41, 23, 24, 30, 13, 18, 47, 51, 33, 34, 42, 35, 47, 57, 58, 59, 60, 36, 54, 55, 59, 65, 62, 49, 66, 65
Offset: 1

Views

Author

David James Sycamore, Dec 07 2024

Keywords

Comments

Similar definition to A378293, from which this sequence diverges at a(14).
a(n) <= n-1 for all n > 1; equality iff A007953(a(n-1)) >= A007953(a(i)); i = 1..n-1.

Examples

			a(11) = 10 because a(10) = 9, and no prior term has greater sum of decimal digits. Likewise a(17) = 16, a(24) = 23, a(33) = 32. But a(40) = 37 because 2 prior terms have greater digit sums than a(39).
		

Crossrefs

Programs

  • Mathematica
    c[_] := 0; a[1] = j = s = 1; nn = 120;
    Do[k = DigitSum[j]; c[k]++;
      k = Total@ Array[c, k];
      Set[{a[n], j}, {k, k}],
      {n, 2, nn}];
    Array[a, nn] (* Michael De Vlieger, Dec 07 2024 *)