login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A163618
a(2*n) = 2 * a(n). a(2*n - 1) = 2 * a(n) - 2 - (-1)^n, for all n in Z.
2
0, 1, 2, 1, 4, 1, 2, 5, 8, 1, 2, 1, 4, 9, 10, 13, 16, 1, 2, 1, 4, 1, 2, 5, 8, 17, 18, 17, 20, 25, 26, 29, 32, 1, 2, 1, 4, 1, 2, 5, 8, 1, 2, 1, 4, 9, 10, 13, 16, 33, 34, 33, 36, 33, 34, 37, 40, 49, 50, 49, 52, 57, 58, 61, 64, 1, 2, 1, 4, 1, 2, 5, 8, 1, 2, 1, 4, 9, 10, 13, 16, 1, 2, 1, 4, 1, 2, 5, 8, 17
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
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
Cf. A163617.
Sequence in context: A171174 A171173 A268671 * A341691 A275392 A360329
KEYWORD
nonn
AUTHOR
Michael Somos, Aug 01 2009
STATUS
approved