login
A218451
a(n) = 10^n minus its binary weight.
1
0, 8, 97, 994, 9995, 99994, 999993, 9999992, 99999988, 999999987, 9999999989, 99999999985, 999999999987, 9999999999986, 99999999999983, 999999999999980, 9999999999999980, 99999999999999980, 999999999999999976, 9999999999999999981, 99999999999999999974
OFFSET
0,2
LINKS
FORMULA
a(n) = 10^n - A000120(10^n).
a(n) = 10^n - A118738(n).
EXAMPLE
a(2) = 97 because 10^2 = 100, which is 1100100 in binary, having 3 on bits, and 100 - 3 = 97.
a(3) = 994 because 10^3 = 1000, which is 1111101000 in binary, having 6 on bits, and 1000 - 6 = 994.
MATHEMATICA
Table[10^n - DigitCount[10^n, 2, 1], {n, 0, 19}]
PROG
(PARI) a(n)=10^n-hammingweight(5^n) \\ Charles R Greathouse IV, Oct 28 2012
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Alonso del Arte, Oct 28 2012, based on examples for A011371 from Hieronymus Fischer, Jun 06 2012.
EXTENSIONS
More terms from Amiram Eldar, Jul 16 2023
STATUS
approved