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.

A118738 Number of ones in binary expansion of 5^n.

This page as a plain text file.
%I A118738 #49 Nov 14 2024 05:51:07
%S A118738 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,
%T A118738 19,31,33,29,36,37,33,39,34,42,40,44,42,38,46,53,54,49,52,52,53,50,49,
%U A118738 54,60,58,60,54,64,58,74,61,67,74,65,61,77,74,81,86,78,87,85,82,89,83,79
%N A118738 Number of ones in binary expansion of 5^n.
%C A118738 Also binary weight of 10^n, which is verified easily enough: 10^n = 2^n * 5^n; it is obvious that 2^n in binary is a single 1 followed by n 0's, therefore, in the binary expansion of 2^n * 5^n, the 2^n contributes only the trailing zeros. - _Alonso del Arte_, Oct 28 2012
%C A118738 Conjecture: a(n)/n -> log_4(5) = 1.160964... as n -> oo. - _M. F. Hasler_, Apr 17 2024
%H A118738 Robert Israel, <a href="/A118738/b118738.txt">Table of n, a(n) for n = 0..10000</a>
%H A118738 Hugo Pfoertner, <a href="/A118738/a118738.png">Plot of a(n) - 1.160964*n</a>, +-4*sqrt(n), n up to 10^6.
%F A118738 a(n) + A118737(n) = A061785(n) + 1 for n >= 1. - _Robert Israel_, Dec 24 2017 [corrected by _Amiram Eldar_, Jul 27 2023]
%F A118738 a(n) = A000120(A000351(n)) = Hammingweight(5^n). - _M. F. Hasler_, Apr 17 2024
%e A118738 a(2) = 3 because 5^2 = 25 is 11001, which has 3 on bits.
%p A118738 seq(convert(convert(5^n,base,2),`+`),n=0..100); # _Robert Israel_, Dec 24 2017
%t A118738 Table[DigitCount[5^n, 2, 1], {n, 0, 71}] (* _Ray Chandler_, Sep 29 2006 *)
%o A118738 (PARI) a(n) = hammingweight(5^n) \\ _Iain Fox_, Dec 24 2017
%o A118738 (Python) A118738 = lambda n: (5**n).bit_count() # For Python 3.10 and later. - _M. F. Hasler_, Apr 17 2024
%o A118738 (Magma) [&+Intseq(5^n, 2): n in [0..100]]; // _Vincenzo Librandi_, Nov 13 2024
%Y A118738 Cf. A000120 (Hamming weight), A000351 (5^n), A061785 (floor(log_2(5^n))), A118737 (number of bits 0 in 5^n).
%Y A118738 Cf. A011754 (analog for 3^n).
%K A118738 base,nonn,easy
%O A118738 0,2
%A A118738 _Zak Seidov_, May 22 2006