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.

A200648 Length of Stolarsky representation of n.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 3, 4, 3, 4, 4, 4, 5, 4, 4, 5, 4, 5, 5, 5, 6, 4, 5, 5, 5, 6, 5, 5, 6, 5, 6, 6, 6, 7, 5, 5, 6, 5, 6, 6, 6, 7, 5, 6, 6, 6, 7, 6, 6, 7, 6, 7, 7, 7, 8, 5, 6, 6, 6, 7, 6, 6, 7, 6, 7, 7, 7, 8, 6, 6, 7, 6, 7, 7, 7, 8, 6, 7, 7, 7, 8, 7, 7, 8, 7, 8, 8
Offset: 1

Views

Author

Casey Mongoven, Nov 19 2011

Keywords

Comments

For the Stolarsky representation of n, see the C. Mongoven link.
Conjecture: a(n) is the sum of row n-1 of A385886. To obtain it, first take maximal anti-run lengths of binary indices of each nonnegative integer (giving A384877), then remove all duplicate rows (giving A385886), and finally take the sum of each remaining row. For length instead of sum we appear to have A200649. - Gus Wiseman, Jul 21 2025

Examples

			The Stolarsky representation of 19 is 11101. This is of length 5. So a(19) = 5.
		

Crossrefs

Counting just ones gives A200649.
Counting just zeros gives A200650.
Stolarsky representation is listed by A385888, ranks A200714.
A000120 counts 1's in binary expansion.
A384890 counts maximal anti-runs of binary indices, ranks A385816.
A385886 lists maximal anti-run lengths of binary indices.

Programs

  • Mathematica
    stol[n_] := stol[n] = If[n == 1, {}, If[n != Round[Round[n/GoldenRatio]*GoldenRatio], Join[stol[Floor[n/GoldenRatio^2] + 1], {0}], Join[stol[Round[n/GoldenRatio]], {1}]]];
    a[n_] := If[n == 1, 1, Length[stol[n]]]; Array[a, 100] (* Amiram Eldar, Jul 07 2023 *)
  • PARI
    stol(n) = {my(phi=quadgen(5)); if(n==1, [], if(n != round(round(n/phi)*phi), concat(stol(floor(n/phi^2) + 1), [0]), concat(stol(round(n/phi)), [1])));}
    a(n) = if(n == 1, 1, #stol(n)); \\ Amiram Eldar, Jul 07 2023

Formula

a(n) = A200649(n) + A200650(n). - Michel Marcus, Mar 14 2023

Extensions

More terms from Amiram Eldar, Jul 07 2023