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-2 of 2 results.

A011373 Number of 1's in binary expansion of Fibonacci(n).

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 3, 3, 2, 5, 4, 2, 5, 6, 4, 8, 7, 4, 5, 8, 6, 8, 11, 6, 6, 9, 11, 11, 12, 8, 11, 9, 13, 12, 11, 12, 14, 10, 12, 16, 17, 14, 16, 18, 15, 21, 13, 12, 18, 18, 17, 17, 17, 16, 22, 21, 16, 24, 20, 16, 19, 26, 23, 20, 25, 19, 26, 15, 23, 23, 22, 25, 27, 24, 23, 23, 22
Offset: 0

Views

Author

Keywords

Examples

			a(8) = 3 because Fibonacci(8) = 21, which in binary is 11001 and that has 3 on bits.
a(9) = 2 because Fibonacci(9) = 34, which in binary is 100010 and that only has 2 on bits.
		

Crossrefs

Programs

  • Maple
    A000120 := proc(n) add(d,d=convert(n,base,2)) ; end proc:
    A011373 := proc(n) A000120(combinat[fibonacci](n)) ; end proc:
    seq(A011373(n),n=0..50) ; # R. J. Mathar, Mar 22 2011
  • Mathematica
    DigitCount[#, 2, 1]&/@Fibonacci[Range[0, 79]] (* Harvey P. Dale, Mar 14 2011 *)
    Table[Plus@@IntegerDigits[Fibonacci[n], 2], {n, 0, 79}]
  • PARI
    a(n)=hammingweight(fibonacci(n)) \\ Charles R Greathouse IV, Mar 02 2014
    
  • Python
    from sympy import fibonacci
    def a(n): return int(fibonacci(n)).bit_count() # David Radcliffe, Jul 03 2025
  • Scala
    def fibonacci(n: BigInt): BigInt = {
      val zero = BigInt(0)
      def fibTail(n: BigInt, a: BigInt, b: BigInt): BigInt = n match {
        case `zero` => a
        case _ => fibTail(n - 1, b, a + b)
      }
      fibTail(n, 0, 1)
    } // Based on tail recursion by Dario Carrasquel
    (0 to 79).map(fibonacci().bitCount) // _Alonso del Arte, Apr 13 2019
    

Formula

a(n) = A000120(A000045(n)). - Michel Marcus, Dec 27 2014
a(n) = [x^Fibonacci(n)] (1/(1 - x))*Sum_{k>=0} x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Mar 27 2018
Conjecture: Limit_{n->oo} a(n)/n = log_2(phi)/2 = A242208/2 = 0.3471209568... . - Amiram Eldar, May 13 2022
Limit_{n->oo} a(n) = oo by a result of C. L. Stewart, linked above. - David Radcliffe, Jul 03 2025

A218076 Indices of positive Fibonacci numbers whose binary expansions have record numbers of consecutive zeros.

Original entry on oeis.org

3, 6, 12, 19, 38, 42, 68, 243, 384, 515, 740, 1709, 5151, 11049, 45641, 94729, 185610, 644593, 726681, 2296396, 3098358, 6178778, 15743325, 22436908, 80141430, 84300971, 127495932, 177416979, 198423144, 275354607
Offset: 1

Views

Author

Peter Polm, Oct 20 2012

Keywords

Comments

Positions of records in the auxiliary sequence 0, 0, 0, 1, 0, 1, 3, 1, 1, 3, 1, 2, 4, 2, 2, 3, 1, 3, 4, 5, 2,... = A087117(Fibonacci(n)). - R. J. Mathar, Nov 05 2012

Examples

			The first four records occur at 3, 6, 12, and 19:
F(3) = 10_2 (one zero),
F(6) = 1000_2 (three zeros),
F(12) = 10010000_2 (four zeros), and
F(19) = 1000001010101_2 (five zeros).
For the n=6178778, F(6178778) has 43 consecutive zeros.
		

Crossrefs

Extensions

More terms from Peter Polm's web site, Joerg Arndt, Aug 18 2014
Showing 1-2 of 2 results.