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.

A348400 a(1) = 1; a(n+1) = a(n) + n if the digit sum of a(n) is already in the sequence, otherwise a(n+1) = digitsum(a(n)).

Original entry on oeis.org

1, 2, 4, 7, 11, 16, 22, 29, 37, 10, 20, 31, 43, 56, 70, 85, 13, 30, 3, 22, 42, 6, 28, 51, 75, 12, 38, 65, 93, 122, 5, 36, 9, 42, 76, 111, 147, 184, 222, 261, 301, 342, 384, 15, 59, 14, 60, 107, 8, 57, 107, 158, 210, 263, 317, 372, 428, 485, 17, 76, 136, 197, 259
Offset: 1

Views

Author

Rodolfo Kurchan, Oct 21 2021

Keywords

Comments

Do all the positive integers appear in this sequence?
With 10^6 terms, 87, 89, 90, 91, 92, 94, 95, 96, 97, 98, 101, 102, 103, 104, 105, 106, 108, 109, 110, 112 are the smallest numbers that still are not in the sequence.

Examples

			a(8) = 29 and digitsum(29) = 11 is already in the sequence, so a(9) = a(8) + 8 = 29 + 8 = 37.
a(9) = 37 and digitsum(37) = 3 + 7 = 10 is not yet in the sequence, so a(10) = 10.
Written as an irregular triangle, in which each line begins with a term which is the digit sum of its preceding term, the sequence begins:
   1,  2,   4,   7,  11,  16,  22,  29,  37;
  10, 20,  31,  43,  56,  70,  85;
  13, 30;
   3, 22,  42;
   6, 28,  51,  75;
  12, 38,  65,  93, 122;
   5, 36;
   9, 42,  76, 111, 147, 184, 222, 261, 301, 342, 384;
  15, 59;
  14, 60, 107;
  ...
		

Crossrefs

Programs

  • Mathematica
    seq[len_] := Module[{s = {1}, k, d, i = 1}, While[Length[s] < len, k = s[[-1]]; If[MemberQ[s, (d = Plus @@ IntegerDigits[k])], AppendTo[s, k + i], AppendTo[s, d]]; i++]; s]; seq[50] (* Amiram Eldar, Oct 21 2021 *)
  • PARI
    See Links section.

Extensions

Definition clarified by Amiram Eldar, Oct 23 2021