OFFSET
0,2
COMMENTS
Take n, write it in binary, see what Rule 30 would do to that state, convert it to decimal: that is a(n). For example, we can see in A110240 that 7 = 111_2 becomes 25 = 11001_2 under Rule 30, which is shown here by a(7) = 25. - N. J. A. Sloane, Nov 25 2016
The sequence is injective: no value occurs more than once.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..16383
Eric Weisstein's World of Mathematics, Rule 30
FORMULA
MATHEMATICA
a[n_] := BitXor[n, BitOr[2n, 4n]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 23 2016 *)
PROG
(Scheme) (define (A269160 n) (A003987bi n (A003986bi (* 4 n) (* 2 n)))) ;; Where A003986bi and A003987bi are implementation of dyadic functions giving bitwise-OR (A003986) and bitwise-XOR (A003987) of their arguments.
(PARI) a(n) = bitxor(n, bitor(2*n, 4*n)); \\ Michel Marcus, Feb 23 2016
(Python)
def A269160(n): return n^(n<<1 | n<<2) # Chai Wah Wu, Jun 29 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 20 2016
STATUS
approved