A356195 The binary expansion of a(n) is obtained by applying the totalistic cellular automaton with rule 2*n to the binary expansion of n.
0, 1, 0, 3, 0, 6, 3, 7, 0, 14, 3, 14, 0, 9, 7, 15, 0, 30, 3, 30, 0, 25, 7, 30, 0, 16, 12, 29, 7, 23, 15, 31, 0, 62, 3, 62, 0, 57, 7, 62, 0, 48, 12, 61, 7, 55, 15, 62, 0, 32, 28, 60, 7, 38, 28, 61, 0, 33, 19, 51, 15, 47, 31, 63, 0, 126, 3, 126, 0, 121, 7, 126
Offset: 0
Examples
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.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..8192
- Eric Weisstein's World of Mathematics, Totalistic Cellular Automaton
- Index entries for sequences related to binary expansion of n
- Index entries for sequences related to cellular automata
Programs
-
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) }
Comments