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.

A373072 Row sums of A346914.

Original entry on oeis.org

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

Views

Author

Paolo Xausa, May 22 2024

Keywords

Comments

See A346914 for more information.

Crossrefs

Cf. A346914.

Programs

  • Mathematica
    (* Uses Algorithm O from Knuth's TAOCP section 7.2.1.6 *)
    olist[m_] := Block[{p = Range[m] - 1, j, d, k},
        Reap[
        While[True,
            Sow[p];
            If[p[[m]] > 0,
                p[[m]] = p[[p[[m]]]],
                k = m; While[k > 0 && p[[--k]] == 0];
                If[k == 0, Break[]];
                j = p[[k]]; d = k-- -j;
                While[++k <= m, p[[k]] = If[p[[k-d]] == p[[j]], p[[j]], p[[k-d]] + d]]
        ]]][[2, 1]]];
    Flatten[Total[Array[olist, 6], {3}]]