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.

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.

Original entry on oeis.org

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

Views

Author

David James Sycamore, Nov 23 2024

Keywords

Comments

Definition related to that of the paint sprayer sequence A279818 so we may see similar behaviors and plots for this sequence.
From Michael De Vlieger, Dec 08 2024: (Start)
Let c(d) be the cardinality of digits d in a(k), k = 1..n-m. Then a(n) is the sum of d*c(d) across the set of (distinct) digits in a(n-m), m = 2. Then it is easy to see that zeros have no effect on the sums.
Scatterplot shows "rays" associated with distinct digits in a(n-2), therefore there are 2^(b-1) rays. Since b = 10, there are 512 rays in the plot, just as there are in A279818.
A279818 is the case regarding m = 1.
A378360(n) is the sum of (d+[d=0])*c(d) across the set of digits in a(n-m), m = 1, starting instead with a(1) = 0, so as to count zeros, and thus the scatterplot shows 1024 rays. (End)

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)
		

Crossrefs

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 *)