A118738 Number of ones in binary expansion of 5^n.
1, 2, 3, 6, 5, 6, 7, 8, 12, 13, 11, 15, 13, 14, 17, 20, 20, 20, 24, 19, 26, 29, 25, 27, 30, 19, 31, 33, 29, 36, 37, 33, 39, 34, 42, 40, 44, 42, 38, 46, 53, 54, 49, 52, 52, 53, 50, 49, 54, 60, 58, 60, 54, 64, 58, 74, 61, 67, 74, 65, 61, 77, 74, 81, 86, 78, 87, 85, 82, 89, 83, 79
Offset: 0
Examples
a(2) = 3 because 5^2 = 25 is 11001, which has 3 on bits.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
- Hugo Pfoertner, Plot of a(n) - 1.160964*n, +-4*sqrt(n), n up to 10^6.
Crossrefs
Programs
-
Magma
[&+Intseq(5^n, 2): n in [0..100]]; // Vincenzo Librandi, Nov 13 2024
-
Maple
seq(convert(convert(5^n,base,2),`+`),n=0..100); # Robert Israel, Dec 24 2017
-
Mathematica
Table[DigitCount[5^n, 2, 1], {n, 0, 71}] (* Ray Chandler, Sep 29 2006 *)
-
PARI
a(n) = hammingweight(5^n) \\ Iain Fox, Dec 24 2017
-
Python
A118738 = lambda n: (5**n).bit_count() # For Python 3.10 and later. - M. F. Hasler, Apr 17 2024
Formula
a(n) + A118737(n) = A061785(n) + 1 for n >= 1. - Robert Israel, Dec 24 2017 [corrected by Amiram Eldar, Jul 27 2023]
Comments