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.

A347062 Record the number of zero terms having a following term, then the number of terms equal to 1 having a following term, then 2, 3, etc. until recording a zero, whereupon the count is reset.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 1, 0, 3, 3, 1, 2, 0, 4, 4, 2, 2, 2, 0, 5, 4, 5, 2, 3, 2, 0, 6, 4, 7, 3, 4, 2, 1, 1, 0, 7, 6, 8, 4, 5, 2, 2, 2, 1, 0, 8, 7, 11, 4, 6, 3, 3, 3, 2, 0, 9, 7, 12, 7, 7, 3, 3, 6, 2, 1, 0, 10, 8, 13, 9, 7, 3, 4, 7, 3, 2, 1, 1, 1, 1, 0, 11, 12, 14, 11, 8
Offset: 0

Views

Author

David James Sycamore, Oct 16 2021

Keywords

Comments

Inventory sequence recording the number of existing terms immediately following occurrences of a zero term, then the number immediately following occurrences of 1, then 2, and so on until another zero is recorded, after which the count is reset. Inclusion of a term in any count requires it to have been followed by another term first, therefore lead terms are not included in the current count.
The scatterplot exhibits trajectories attributable to the register of occurrences of the immediately-preceding term m, c(m), and irregular periodicity of nondecreasing length. - Michael De Vlieger, Oct 16 2021
Suggested by A342585.

Examples

			At first there are no terms, thus none following a zero, so a(0) = 0.
After a(0) = 0 the count is reset, and since there are still no terms following a zero, a(1) = 0. The count is now reset again and we have one term a(1) = 0 which follows a zero term, so a(2) = 1.
We now have 0,0,1 and because no term yet follows 1, a(3) must be 0 (the lead term here is 1 but it is not counted).
The count is now reset and there are two terms (a(1) and a(2)) which follow a zero term, thus a(4) = 2; etc.
As an irregular triangle the sequence begins:
0;
0;
1, 0;
2, 1, 1, 0;
3, 3, 1, 2, 0;
4, 4, 2, 2, 2, 0;
5, 4, 5, 2, 3, 2, 0;
6, 4, 7, 3, 4, 2, 1, 1, 0;
...
		

Crossrefs

Programs

  • Mathematica
    Block[{c, k, m, n}, c[0] = 1; m = 0; {0, 0}~Join~Reap[Do[k = 0; While[IntegerQ[c[k]], Set[n, c[k]]; Sow[n]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; Set[m, n]; k++]; Sow[0]; If[IntegerQ@ c[m], c[m]++, c[m] = 1]; Set[m, 0], 11]][[-1, -1]]] (* Michael De Vlieger, Oct 16 2021 *)