Search: seq:0,0,1,1,0,1,1,2,1,0,1,2,2,2,3,4,1,1,3,4,3,1,5,5,2,5,3,5,5,3,4,6,7,7,6,8,5,7,9,8,6,4,6,6,6,8,7,9,6,8,9,9,8,8,11,10,10,7,8,10
|
| |
|
|
A055254
|
|
Number of odd digits in 2^n.
|
|
+30
4
|
|
|
|
1, 0, 0, 0, 1, 1, 0, 1, 1, 2, 1, 0, 1, 2, 2, 2, 3, 4, 1, 1, 3, 4, 3, 1, 5, 5, 2, 5, 3, 5, 5, 3, 4, 6, 7, 7, 6, 8, 5, 7, 9, 8, 6, 4, 6, 6, 6, 8, 7, 9, 6, 8, 9, 9, 8, 8, 11, 10, 10, 7, 8, 10, 7, 9, 10, 10, 7, 12, 13, 13, 12, 6, 7, 12, 10, 15, 16, 12, 12, 10, 12, 13, 10, 14, 14, 12, 16, 13, 11, 13, 12
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
0,10
|
|
|
COMMENTS
|
Related sequence b(n) = Number of digits in 2^n that are at least 5. a(0) = 1, b(0) = 0 and a(n+1) = b(n), as a digit with value 5 of higher in 2^n will generate an odd digit in 2^(n+1). In the Nieuw Archief voor Wiskunde link there is a proof that sum(k>=, b(k)/2^k) = 2/9. - Jaap Spies, Mar 13 2009
|
|
|
REFERENCES
|
J. Borwein, D. Bailey and R. Girgensohn, Experimentation in mathematics : computational paths to discovery, A. K. Peters, 2004, pp. 14-15.
|
|
|
LINKS
|
|
|
|
FORMULA
|
Sum(k>=0,a(k)/2^k)=11/9 (for a proof see the comment above). [Corrected by Jaap Spies, Mar 13 2009]
|
|
|
EXAMPLE
|
2^30 = 1073741824 and 1073741824 contains 5 odd decimal digits hence a(30)=5.
|
|
|
MAPLE
|
A055254 := proc(val) local i, j, k, n; n := 2^val; j := 0; k := floor(ln(n)/ln(10))+1; for i from 1 to k do if (n mod 10) mod 2 = 1 then j := j+1 fi; n := floor(n/10); od; RETURN(j); end: seq(A055254(n), n=0..110); # Jaap Spies
|
|
|
MATHEMATICA
|
A055254[N_] := Count[ #, True] & /@ Map[OddQ, IntegerDigits /@ (2^# & /@ Range[N])] (* This generates a table of the number of odd digits in the first N powers of two *) (* Douglas Skinner (skinnerd(AT)comcast.net), Dec 06 2007 *)
Table[Count[IntegerDigits[2^n], _?OddQ], {n, 0, 90}] (* Harvey P. Dale, Mar 25 2015 *)
|
|
|
PROG
|
(Perl) sub a{my $m; map $m+=1&$_, split //, 1<<pop; $m}
(Python)
def a(n): return sum(1 for d in str(1<<n) if d in "13579")
|
|
|
CROSSREFS
|
|
|
|
KEYWORD
|
nonn,base,easy
|
|
|
AUTHOR
|
Asher Auel (asher.auel(AT)reed.edu), May 05 2000
|
|
|
EXTENSIONS
|
|
|
|
STATUS
|
approved
|
| |
|
Search completed in 0.002 seconds
|