OFFSET
0,4
COMMENTS
This sequence is a variant of A352528; here the cellular automaton maps 2 cells into 1, there 3 cells into 1.
The binary digit of a(n) at place value 2^k is a function of the binary digits of n at place values 2^(k+1) and 2^k (and of (2*n) mod 256).
We use even elementary cellular automaton rules, so "00" will always evolve to "0", and the binary expansion of a(n) will have finitely many 1's and will be correctly defined.
LINKS
FORMULA
a(2^k-1) = 2^k-1 for any k <> 2.
a(2^k) = 0 for any k > 1.
EXAMPLE
For n = 11:
- we use rule 22 mod 16 = 6,
- the binary expansion of 6 is "0110", so we apply the following evolutions:
11 10 01 00
| | | |
v v v v
0 1 1 0
- the binary expansion of 11 (with a leading 0's) is "...01011",
- the binary digit of a(11) at place value 2^0 is 0 (from "11"),
- the binary digit of a(11) at place value 2^1 is 1 (from "01"),
- the binary digit of a(11) at place value 2^2 is 1 (from "10"),
- the binary digit of a(11) at place value 2^3 is 1 (from "01"),
- the binary digit of a(11) at other places is 0 (from "00"),
- so the binary expansion of a(11) is "1110",
- and a(11) = 14.
PROG
(PARI) a(n) = { my (v=0, m=n); for (k=0, oo, if (m==0, return (v), bittest(2*n, m%4), v+=2^k); m\=2) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jul 29 2022
STATUS
approved