%I #12 Dec 08 2024 17:23:38
%S 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,
%T 9,21,18,30,35,15,33,32,24,49,52,59,51,66,48,36,68,72,88,56,56,94,105,
%U 85,64,119,110,70,18,35,91,93,83,108,119,109,104,114,73,79
%N 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.
%C Definition related to that of the paint sprayer sequence A279818 so we may see similar behaviors and plots for this sequence.
%C From _Michael De Vlieger_, Dec 08 2024: (Start)
%C 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.
%C 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.
%C A279818 is the case regarding m = 1.
%C 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)
%H Michael De Vlieger, <a href="/A378316/b378316.txt">Table of n, a(n) for n = 1..10000</a>
%H Michael De Vlieger, <a href="/A378316/a378316.png">Log log scatterplot of a(n)</a>, n = 1..10^6.
%e From _Michael De Vlieger_, Dec 08 2024: (Start)
%e Let c(d) be the number of digits d in a(k), k = 1..n-2.
%e a(3) = 1 since a(1) = 1.
%e a(4) = 2 since a(2) = 2.
%e a(5) = 2 since a(1) = a(3) = 1, i.e., 1*c(1) = 1*2 = 2.
%e a(6) = 4 since a(2) = a(4) = 2, i.e., 2*c(2) = 2*2 = 4.
%e a(7) = 6 since a(2) = a(4) = a(5) = 2, i.e., 2*c(2) = 2*3 = 6.
%e a(13) = 11 since a(11) = 12, and 1*c(1) + 2*c(2) = 1*3 + 2*4 = 3+8 = 11.
%e 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)
%t nn = 120; a[1] = i = 1; a[2] = j = 2; c[_] := 0;
%t Do[(k = Total@ Map[#1*(c[#1] += #2) & @@ # &, #]) &@
%t Tally@ IntegerDigits[i];
%t Set[{a[n], i, j}, {k, j, k}], {n, 3, nn}];
%t Array[a, nn] (* _Michael De Vlieger_, Dec 08 2024 *)
%Y Cf. A007953, A279818, A378359, A378360.
%K nonn,base,easy
%O 1,2
%A _David James Sycamore_, Nov 23 2024