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.

A378359 a(1) = 0, a(n) = Sum_{digits d in a(n-1)} c(d,n-1), where c(d,k) is the number of digits d in a(1..k).

This page as a plain text file.
%I A378359 #16 Nov 27 2024 18:35:52
%S A378359 0,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,13,14,15,16,17,18,19,20,5,3,
%T A378359 3,4,3,5,4,4,5,5,6,3,6,4,6,5,7,3,7,4,7,5,8,3,8,4,8,5,9,3,9,4,9,5,10,
%U A378359 23,13,31,33,14,32,19,29,12,30,21,32,25,20,16,32
%N A378359 a(1) = 0, a(n) = Sum_{digits d in a(n-1)} c(d,n-1), where c(d,k) is the number of digits d in a(1..k).
%C A378359 We begin with the empty sum 0.
%C A378359 This sequence also counts zeros in the decimal expansion of a number.
%H A378359 Michael De Vlieger, <a href="/A378359/b378359.txt">Table of n, a(n) for n = 1..10000</a>
%H A378359 Michael De Vlieger, <a href="/A378359/a378359.png">Scalar scatterplot of a(n)</a>, n = 1..10^5.
%H A378359 Michael De Vlieger, <a href="/A378359/a378359_1.png">Log log scatterplot of a(n)</a>, 1 = 1..10^6.
%H A378359 Michael De Vlieger, <a href="/A378359/a378359_2.png">Log log scatterplot of c(d,n-1)</a> for d = 0..9 and n = 1..10^5, with a color function where black indicates d = 0, red d = 1, orange d = 2, ..., purple d = 9.
%e A378359 Let c(d) represent c(d,n-1) for concision below:
%e A378359 a(2) = 1 since a(1) = 0; c(0) = 1.
%e A378359 a(3) = 1 since a(2) = 1; c(1) = 1.
%e A378359 a(4) = 2 since a(3) = 1; c(1) = 2.
%e A378359 ...
%e A378359 a(20) = 10 since a(19) = 1, c(1) = 10.
%e A378359 a(21) = 13 since a(20) = 10, c(0)+c(1) = 2+11 = 13.
%e A378359 ...
%e A378359 a(28) = 20 since a(27) = 19, c(1)+c(9) = 18+2 = 20.
%e A378359 a(29) = 5 since a(28) = 20, c(0)+c(2) = 3+2 = 5.
%e A378359 ..
%e A378359 a(68) = 14 since a(67) = 33, c(3) = 14 (note: not 2*c(3) = 28), etc.
%t A378359 nn = 10^4; a[1] = j = 0; c[_] := 0;
%t A378359 Do[k = Total@ Map[c[#1] += #2 & @@ # &, Tally@ IntegerDigits[j] ];
%t A378359   Set[{a[n], j}, {k, k}], {n, 2, nn}]; Array[a, nn]
%o A378359 (PARI)
%o A378359 notdoin(d,n) = if(!d && !n, 1, #select(x->x==d,digits(n))); \\ "notdoin" = number of times digit occurs in n
%o A378359 A378359list(up_to_n) = { my(v=vector(up_to_n)); v[1] = 0; for(n=2, up_to_n, my(digs = if(2==n,[0],vecsort(digits(v[n-1]),,8))); v[n] = sum(i=1,#digs,sum(j=1,n-1,notdoin(digs[i],v[j])))); (v); }; \\ _Antti Karttunen_, Nov 25 2024
%o A378359 (Python)
%o A378359 from itertools import islice
%o A378359 from collections import Counter
%o A378359 def agen(): # generator of terms
%o A378359     an, c = 0, Counter()
%o A378359     while True:
%o A378359         yield an
%o A378359         s = str(an)
%o A378359         c.update(s)
%o A378359         an = sum(c[d] for d in set(s))
%o A378359 print(list(islice(agen(), 80))) # _Michael S. Branicky_, Nov 25 2024
%Y A378359 Cf. A279818.
%K A378359 nonn,base,easy
%O A378359 1,4
%A A378359 _Michael De Vlieger_ and _David James Sycamore_, Nov 24 2024