OFFSET
0,3
COMMENTS
Conjectures: the sequence contains 8 zeros, and more positive terms than negative.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 0..10000
FORMULA
a(0)=0, a(1)=1, a(n)=(a(n-1) XOR n) - a(n-2), where XOR is the bitwise exclusive-or operator.
PROG
(Python)
prpr = 0
prev = 1
for n in range(2, 99):
current = (prev ^ n) - prpr
print prpr,
prpr = prev
prev = current
(PARI) v=vector(100); v[1]=0; v[2]=1; for(i=3, #v, v[i]=bitxor(v[i-1], i-1)-v[i-2]); v \\ Charles R Greathouse IV, May 03 2012
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Alex Ratushnyak, May 03 2012
STATUS
approved