login
Write Pi-3 in binary and report the number of ones in the first 10^n decimal places.
2

%I #2 Mar 30 2012 17:31:24

%S 2,40,488,4985,50077,499721,5002607,5000079

%N Write Pi-3 in binary and report the number of ones in the first 10^n decimal places.

%F A160228(n)+A160229(n)=A011557(n) for n=1...

%t f[n_] := Count[ RealDigits[Pi - 3, 2, 10^n - 2][[1]], 1] + 2; Do[ Print[{n, f@n}], {n, 8}]

%Y Cf. A004601, A011557, A160229.

%K base,nonn

%O 1,1

%A _Robert G. Wilson v_, May 04 2009