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.

Showing 1-4 of 4 results.

A112310 Number of terms in lazy Fibonacci representation of n.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 4, 3, 3, 4, 3, 4, 4, 4, 5, 3, 4, 4, 4, 5, 4, 4, 5, 4, 5, 5, 5, 6, 4, 4, 5, 4, 5, 5, 5, 6, 4, 5, 5, 5, 6, 5, 5, 6, 5, 6, 6, 6, 7, 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, 5, 6, 5, 6, 6, 6, 7, 5, 6, 6, 6, 7, 6, 6, 7, 6
Offset: 0

Views

Author

N. J. A. Sloane, Dec 01 2005

Keywords

Comments

Equivalently, the number of ones in the maximal Fibonacci bit-representation (A104326) of n.
Conjecture: if we split the sequence in groups that contain Fibonacci(k) terms like (0), (1), (1, 2), (2, 2, 3), (2, 3, 3, 3, 4), (3, 3, 4, 3, 4, 4, 4, 5) etc, the sums in the groups are the terms of A023610. - Gary W. Adamson, Nov 02 2010
Equivalently, the number of periods in the length-n prefix of the infinite Fibonacci word (A003849). An integer p, 1 <= p <= n, is a period of a length-n word x if x[i] = x[i+p] for 1 <= i <= n-p. - Jeffrey Shallit, May 23 2020

Examples

			a(10) = 3 because A104326(10) = 1110 contains three ones.
		

Crossrefs

Number of terms in row n of A112309.
Record positions are in A001911. - Ray Chandler, Dec 01 2005

Programs

  • Haskell
    a112310 n = a112310_list !! n
    a112310_list = concat fss where
       fss = [0] : [1] : (map (map (+ 1))) (zipWith (++) fss $ tail fss)
    -- Reinhard Zumkeller, Oct 26 2013
  • Maple
    A112310 := proc(n)
        convert(A104326(n),base,10) ;
        add(d,d=%) ;
    end proc:
    seq(A112310(n),n=0..120) ; # R. J. Mathar, Aug 28 2025
  • Mathematica
    DeleteCases[IntegerDigits[Range[200], 2], {_, 0, 0, _}]
    A112309 = Map[DeleteCases[Reverse[#] Fibonacci[Range[Length[#]] + 1], 0] &, DeleteCases[IntegerDigits[-1 + Range[200], 2], {_, 0, 0, _}]]
    A112310 = Map[Length, A112309]
    (* Peter J. C. Moses, Mar 03 2015 *)

Formula

a(n) = A007953(A104326(n)). - Amiram Eldar, Oct 10 2023

Extensions

Extended by Ray Chandler, Dec 01 2005
Merged with a sequence from Casey Mongoven, Mar 20 2006, by Franklin T. Adams-Watters, Dec 19 2006

A200650 Number of 0's in Stolarsky representation of n.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 1, 1, 0, 2, 2, 1, 2, 1, 1, 1, 0, 3, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 0, 3, 3, 2, 3, 2, 2, 2, 1, 3, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 0, 4, 3, 3, 3, 2, 3, 3, 2, 3, 2, 2, 2, 1, 3, 3, 2, 3, 2, 2, 2, 1, 3, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 0, 4, 4, 3, 4, 3, 3, 3, 2, 4, 3, 3
Offset: 1

Views

Author

Casey Mongoven, Nov 19 2011

Keywords

Comments

For the Stolarsky representation of n, see the C. Mongoven link.
a(n+1), n >= 1, gives the size of the n-th generation of each of the "[male-female] pair of Fibonacci rabbits" in the Fibonacci rabbits tree read right-to-left by row, the first pair (the root) being the 0th generation. (Cf. OEIS Wiki link below.) - Daniel Forgues, May 07 2015
From Daniel Forgues, May 07 2015: (Start)
Concatenation of:
0: 1,
1: 0,
2: 0,
3: 1, 0,
4: 1, 1, 0,
5: 2, 1, 1, 1, 0,
6: 2, 2, 1, 2, 1, 1, 1, 0,
(...),
where row n, n >= 3, is row n-1 prepended by incremented row n-2. (End)
For n >= 3, this algorithm yields the next F_n terms of the sequence, where F_n is the n-th Fibonacci number (A000045). Since it is asymptotic to (phi^n)/sqrt(5), the number of terms thus obtained grows exponentially at each step! - Daniel Forgues, May 22 2015
Conjecture: a(n) is one less than the length of row n-1 of A385817. To obtain it, first take maximal run lengths of binary indices of each nonnegative integer (giving A245563), then remove all duplicate rows (giving A385817), and finally take the length of each remaining row and subtract 1. For sum instead of length we appear to have A200648. For anti-runs instead of runs we appear to have A341259 = A200649-1. - Gus Wiseman, Jul 21 2025
How is this related to A117479? - R. J. Mathar, Aug 10 2025

Examples

			The Stolarsky representation of 19 is 11101. This has one 0. So a(19) = 1.
		

Crossrefs

For length instead of number of 0's we have A200648.
For sum (or number of 1's) instead of number of 0's we have A200649.
Stolarsky representation is listed by A385888, ranks A200714.
A000120 counts 1's in binary expansion, 0's A023416.
A069010 counts maximal runs of binary indices, ranked by A385889.
A245563 lists maximal run lengths of binary indices, duplicates removed A385817.

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, Count[stol[n], 0]]; 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,  my(s = stol(n)); #s - vecsum(s)); \\ Amiram Eldar, Jul 07 2023

Formula

a(n) = A200648(n) - A200649(n). - Amiram Eldar, Jul 07 2023

Extensions

Corrected and extended by Kenny Lau, Jul 04 2016

A341259 Number of 0's in n-th word defined at A341258.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Mar 16 2021

Keywords

Comments

The number of 1's in the n-th word is given by A117479.

Crossrefs

Appears to be A200649 - 1.

Programs

  • Mathematica
    z = 200; r = (1 + Sqrt[5])/2;
    s = Table[Floor[r*n], {n, 1, z}]; t = Complement[Range[Max[s]], s];
    s1[n_] := Length[Intersection[Range[n - 1], s]];
    t1[n_] := n - 1 - s1[n];
    w[1] = {0}; w[t[[1]]] = {1};
    w[n_] := If[MemberQ[s, n], Join[{0}, w[s1[n]]], Join[{1}, w[t1[n]]]]
    tt = Table[w[n], {n, 1, z}] (* A341258 *)
    c[n_] := Count[tt[[n]], 0]; Table[c[n], {n, 1, z}]  (* A341259 *)
    d[n_] := Count[tt[[n]], 1]; Table[d[n], {n, 1, z}]  (* A117479 *)

A356894 a(n) is the number of 0's in the maximal tribonacci representation of n (A352103).

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 1, 0, 2, 2, 1, 2, 1, 1, 0, 3, 2, 3, 2, 2, 1, 2, 2, 1, 2, 1, 1, 0, 4, 3, 3, 2, 3, 3, 2, 3, 2, 2, 1, 3, 2, 3, 2, 2, 1, 2, 2, 1, 2, 1, 1, 0, 4, 4, 3, 4, 3, 3, 2, 4, 3, 4, 3, 3, 2, 3, 3, 2, 3, 2, 2, 1, 4, 3, 3, 2, 3, 3, 2, 3, 2, 2, 1, 3, 2, 3, 2
Offset: 0

Views

Author

Amiram Eldar, Sep 03 2022

Keywords

Examples

			  n  a(n)  A352103(n)
  -  ----  ----------
  0     1           0
  1     0           1
  2     1          10
  3     0          11
  4     2         100
  5     1         101
  6     1         110
  7     0         111
  8     2        1001
  9     2        1010
		

Crossrefs

Similar sequences: A023416, A102364, A117479, A278042.

Programs

  • Mathematica
    t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; trib[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; IntegerDigits[Total[2^(s - 1)], 2]]; a[n_] := Module[{v = trib[n]}, nv = Length[v]; i = 1; While[i <= nv - 3, If[v[[i ;; i + 3]] == {1, 0, 0, 0}, v[[i ;; i + 3]] = {0, 1, 1, 1}; If[i > 3, i -= 4]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, 1, Count[v[[i[[1, 1]] ;; -1]], 0]]]; Array[a, 100, 0]

Formula

a(n) = A356895(n) - A352104(n).
Showing 1-4 of 4 results.