OFFSET
1,1
COMMENTS
a(n) is divisible by 3; compare to A199403.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
FORMULA
G.f.: 3*(2*x^3-x^2+1)*x/(4*x^6-x^4-4*x^2+1). - Alois P. Heinz, Nov 05 2011
EXAMPLE
a(2) = 2^1+1 XOR 2^2-1 = 3 XOR 3 = 0;
a(3) = 2^1+1 XOR 2^2-1 XOR 2^3+1 = 3 XOR 3 XOR 9 = 9;
a(4) = 2^1+1 XOR 2^2-1 XOR 2^3+1 XOR 2^4-1 = 3 XOR 3 XOR 9 XOR 15 = 6.
MAPLE
a:= n-> (<<0|1|0>, <0|0|1>, <-4|1|4>>^iquo(n-1, 2, 'r'). `if`(r=0, <<3, 9, 39>>, <<0, 6, 24>>))[1, 1]: seq(a(n), n=1..100); # Alois P. Heinz, Nov 05 2011
PROG
(PARI) {a(n)=if(n<0, 0, bitxor(a(n-1), 2^n-(-1)^n))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Nov 05 2011
STATUS
approved