OFFSET
0,3
COMMENTS
Integers n>=0 such that a(n) = 1 is A118113.
Fibbinary numbers (A003714) give all integers n>=0 for which a(n+1) = 1 or 2. - Michael Somos, Feb 21 2016
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
FORMULA
a(n) = -A163617(-n) for all n in Z.
EXAMPLE
G.f. = x + 2*x^2 + x^3 + 4*x^4 + x^5 + 2*x^6 + 5*x^7 + 8*x^8 + x^9 + 2*x^10 + ...
MATHEMATICA
Table[(-1)*BitOr[-n, -2*n], {n, 0, 50}] (* G. C. Greubel, Jul 30 2017 *)
PROG
(PARI) {a(n) = n=-n; -bitor(n, n<<1)};
(PARI) {a(n) = if( n==0 || n==1, n, 2 * a((n+1) \ 2) - (n%2) * (2 + (-1)^((n+1) \ 2)))};
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, Aug 01 2009
STATUS
approved