OFFSET
0,11
COMMENTS
The binary expansion of a(n) encodes the nonzero digits of the decimal expansion of n.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8191
EXAMPLE
For n = 20!:
- 2432902008176640000 is the decimal expansion of 20!, so
1111101001111110000 is the binary expansion of a(20!),
- a(20!) = 513008.
PROG
(PARI) a(n) = fromdigits(apply(sign, digits(n)), 2)
(Python)
def a(n): return int("".join((('1' if d!='0' else '0') for d in str(n))), 2)
print([a(n) for n in range(87)]) # Michael S. Branicky, May 22 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 21 2021
STATUS
approved