A214923 Total count of 1's in binary representation of Fibonacci(n) and previous Fibonacci numbers, minus total count of 0's. That is, partial sums of b(n) = -A037861(Fibonacci(n)).
-1, 0, 1, 1, 3, 4, 2, 4, 5, 3, 7, 8, 4, 6, 9, 7, 13, 16, 12, 9, 12, 10, 11, 18, 14, 9, 10, 14, 17, 22, 18, 19, 15, 19, 20, 18, 18, 21, 15, 13, 18, 24, 24, 27, 33, 32, 43, 37, 28, 31, 33, 32, 31, 29, 24, 30, 34, 27, 35, 35, 26, 22, 32, 35, 31, 37, 30, 36, 19, 18
Offset: 0
Links
- T. D. Noe, Table of n, a(n) for n = 0..10000
Programs
-
Java
import static java.lang.System.out; import java.math.BigInteger; public class A214923 { public static void main (String[] args) { // 51 minutes BigInteger prpr = BigInteger.valueOf(0); BigInteger prev = BigInteger.valueOf(1), curr; long n, c0=1, c1, sum=0, count0=0, countPos=0, countNeg=0, max=0, min=0, maxAt=0, minAt=0; for (n=0; n<10000000; ++n) { c1 = prpr.bitCount(); if (n>0) c0 = prpr.bitLength() - c1; sum += c1-c0; out.printf("%d, ", sum); if (sum>0) ++countPos; else if (sum<0) ++countNeg; else ++count0; if (sum>max) { max=sum; maxAt=n; } if (sum
-
Mathematica
Accumulate[Table[f = Fibonacci[n]; Count[IntegerDigits[f, 2], 1] - Count[IntegerDigits[f, 2], 0], {n, 0, 100}]] (* T. D. Noe, Jul 30 2012 *)
Comments