A378316 a(1) = 1, a(2) = 2. For n > 2, a(n) is the sum of the digits of a(n-2) plus the sum of the same digits occurring in all terms a(i); 1 <= i <= n-2.
1, 2, 1, 2, 2, 4, 6, 4, 6, 8, 12, 8, 11, 16, 5, 24, 5, 22, 10, 14, 7, 24, 7, 36, 14, 27, 33, 39, 9, 21, 18, 30, 35, 15, 33, 32, 24, 49, 52, 59, 51, 66, 48, 36, 68, 72, 88, 56, 56, 94, 105, 85, 64, 119, 110, 70, 18, 35, 91, 93, 83, 108, 119, 109, 104, 114, 73, 79
Offset: 1
Examples
From _Michael De Vlieger_, Dec 08 2024: (Start) Let c(d) be the number of digits d in a(k), k = 1..n-2. a(3) = 1 since a(1) = 1. a(4) = 2 since a(2) = 2. a(5) = 2 since a(1) = a(3) = 1, i.e., 1*c(1) = 1*2 = 2. a(6) = 4 since a(2) = a(4) = 2, i.e., 2*c(2) = 2*2 = 4. a(7) = 6 since a(2) = a(4) = a(5) = 2, i.e., 2*c(2) = 2*3 = 6. a(13) = 11 since a(11) = 12, and 1*c(1) + 2*c(2) = 1*3 + 2*4 = 3+8 = 11. a(15) = 5 since a(13) = 11, and 1*c(1) = 1*5 = 5; note, there is 1 distinct digit d = 1, but two 1's in a(13), etc. (End)
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Log log scatterplot of a(n), n = 1..10^6.
Programs
-
Mathematica
nn = 120; a[1] = i = 1; a[2] = j = 2; c[_] := 0; Do[(k = Total@ Map[#1*(c[#1] += #2) & @@ # &, #]) &@ Tally@ IntegerDigits[i]; Set[{a[n], i, j}, {k, j, k}], {n, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Dec 08 2024 *)
Comments