|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|