OFFSET
0,4
COMMENTS
To compute the binary expansion of a(n):
- we scan the binary digits of n from right to left,
- at some position k >= 0 (0 corresponding to the least significant bit):
- we count the number of 1's at positions >= k, say we have w 1's,
- if 2^w appears in the binary expansion of 2*n,
then we insert a 1,
otherwise we insert a 0,
- as we are considering an even automaton (with rule 2*n),
once scanning the leading 0's of n, we will only insert 0's,
- and the result will have finitely many 1's.
More formally: 2^k appears in the binary expansion of a(n) iff 2^A000120(floor(n/2^k)) appears in the binary expansion of 2*n.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8192
Eric Weisstein's World of Mathematics, Totalistic Cellular Automaton
FORMULA
EXAMPLE
For n = 43:
- the binary expansion of 2*43 is "1010110",
- so we apply the following totalistic cellular automaton:
w | >=7 6 5 4 3 2 1 0
out | 0 1 0 1 0 1 1 0
- scanning the binary expansion of n, we obtains:
bin(n) | 1 0 1 0 1 1
w | 1 1 2 2 3 4
bin(a(n)) | 1 1 1 1 0 1
- so a(n) = 61.
PROG
(PARI) a(n) = { my (v=0, m=n); for (k=0, oo, if (m==0, return (v), bittest(2*n, hammingweight(m)), v+=2^k); m\=2) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jul 29 2022
STATUS
approved