A279818 a(n+1) = sum of digits of a(n), plus sum of same digits arising in all prior terms; a(1)=1.
1, 1, 2, 2, 4, 4, 8, 8, 16, 9, 9, 18, 28, 38, 43, 18, 53, 14, 22, 10, 7, 7, 14, 28, 68, 76, 39, 39, 51, 19, 55, 20, 14, 35, 43, 49, 86, 96, 93, 96, 117, 41, 50, 30, 27, 51, 50, 40, 40, 44, 52, 63, 72, 62, 70, 49, 146, 130, 50, 50, 55, 65, 130, 54, 139, 157, 156, 172, 109, 131
Offset: 1
Examples
a(2)=1, the sum of digits of a(1); a(3)=1+1=2, the sum of digits of a(1) and a(2), the only terms so far to contain digit 1; a(4)=2, the sum of digits of a(3), the only term so far to contain digit 2; a(5)=2+2=4, since 2 is the only digit appearing in a(4) and a(3); a(6)=4, a(7)=8; etc.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..20000
- Michael De Vlieger, Explanation of the streams evident in the plot of this sequence.
- Michael De Vlieger, Log log plot of a(n) for n = 1..4000000 showing records in red, local minima in blue, and indicating the first term of each stream k= 1..511 in gold.
- Michael De Vlieger, Log log plot of s_d(n) for n = 1..2^18 using a color function to indicate d where d=1 is red, d=9 is purple, and d=0 is black.
- Michael De Vlieger, Example of progenitors a(n-1) that produce a(n) that pertain to digit signature k=138 (i.e., a(n-1) has digits 1, 2, 4, and 8 and any number of zeros). a(n-1) is blue, a(n) in red.
- Michael De Vlieger, Plot of a_6(n) for n = 1..6^7 (base 6 version of this sequence for comparison, exhibiting N = 2^5-1 = 31 streams).
- Michael De Vlieger, Table of the least term m of a given digit signature k, or the first term in stream k.
- Michael De Vlieger, Lineages k represented among the records in this sequence for n = 1..2^22.
- Scott R. Shannon, Plot of a(n) for n = 1..1000000.
Programs
-
Mathematica
Block[{a = {1}, s}, Array[Set[s[#], 0] &, 9]; Do[(MapIndexed[AddTo[s[First[#2]], #1] &, #]; AppendTo[a, Total@ Map[# s[#] &, Position[#, ?(# > 0 &)][[All, 1]] ]]) &@ Most@ DigitCount@ Last@ a, 69]; a ] (* _Michael De Vlieger, Dec 31 2020 *)
-
PARI
lista(nn) = {my(a=1, vsd = vector(9)); print1(a, ", "); for (n = 2, nn, my(s = sumdigits(a)); my(dd = Set(digits(a))); my(rd = digits(a)); a = s + sum(k=1, #dd, if (dd[k], vsd[dd[k]])); print1(a, ", "); for (k=1, #rd, if (rd[k], vsd[rd[k]] += rd[k]);););} \\ Michel Marcus, Nov 06 2019
Extensions
Partially edited by N. J. A. Sloane, Sep 03 2021
Comments