OFFSET
0,2
COMMENTS
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[4n, BitOr[2n, n]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 23 2016 *)
PROG
(Scheme) (define (A269161 n) (A003987bi (* 4 n) (A003986bi (* 2 n) n))) ;; Where A003986bi and A003987bi are implementation of dyadic functions giving bitwise-OR (A003986) and bitwise-XOR (A003987) of their arguments.
(Python)
def A269161(n): return n<<2 ^ (n<<1 |n) # Chai Wah Wu, Jun 29 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 20 2016
STATUS
approved