login
A369857
Number of nonzero bits (a.k.a. binary or Hamming weight) of 7^n.
2
1, 3, 3, 6, 5, 7, 9, 11, 14, 17, 15, 20, 11, 20, 23, 20, 22, 24, 20, 31, 30, 24, 24, 36, 29, 29, 37, 33, 37, 42, 43, 43, 40, 50, 53, 44, 39, 53, 43, 60, 57, 53, 60, 59, 62, 68, 65, 66, 59, 68, 75, 71, 84, 77, 65, 74, 81, 87, 85, 83, 77, 89, 83, 95, 84, 89, 86, 98, 102, 94, 97, 104
OFFSET
0,2
COMMENTS
Conjecture: a(n)/n -> log_4(7) = 1.403677461..., i.e., about half of the bits of 7^n are nonzero.
LINKS
Hugo Pfoertner, Plot of a(n) - 1.40368*n, +-4*sqrt(n), n up to 10^6.
FORMULA
a(n) = A000120(A000420(n)). (Definition of this sequence.)
EXAMPLE
The first few powers of 7 and their binary representation are as follows:
n | 0 | 1 | 3 | 4 | 5 | 6 | ...
----+---+-----+--------+-----------+--------------+-----------------+----
7^n | 1 | 7 | 49 | 343 | 2401 | 16807 | ...
----+---+-----+--------+-----------+--------------+-----------------+----
bin | 1 | 111 | 110001 | 101010111 | 100101100001 | 100000110100111 | ...
----+---+-----+--------+-----------+--------------+-----------------+----
a(n)| 1 | 3 | 3 | 6 | 5 | 7 | ...
----+---+-----+--------+-----------+--------------+-----------------+----
MAPLE
PROG
(PARI) apply( {A369857(n) = hammingweight(7^n)}, [0..99])
(Python) A369857 = lambda n: (7**n).bit_count() # for Python >= 3.10
CROSSREFS
Cf. A000120 (Hamming weight), A000420 (7^n).
Cf. A011754, A118738 (analog for 3^n and 5^n).
Sequence in context: A023822 A318514 A355413 * A071047 A265008 A165606
KEYWORD
nonn
AUTHOR
M. F. Hasler, Apr 17 2024
STATUS
approved