|
|
A094267
|
|
First differences of A001511.
|
|
6
|
|
|
1, -1, 2, -2, 1, -1, 3, -3, 1, -1, 2, -2, 1, -1, 4, -4, 1, -1, 2, -2, 1, -1, 3, -3, 1, -1, 2, -2, 1, -1, 5, -5, 1, -1, 2, -2, 1, -1, 3, -3, 1, -1, 2, -2, 1, -1, 4, -4, 1, -1, 2, -2, 1, -1, 3, -3, 1, -1, 2, -2, 1, -1, 6, -6, 1, -1, 2, -2, 1, -1, 3, -3, 1, -1, 2, -2, 1, -1, 4, -4, 1, -1, 2, -2, 1, -1, 3, -3, 1, -1, 2, -2, 1, -1, 5, -5, 1, -1, 2, -2, 1, -1, 3, -3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
For n even, Sum_{k=1..n} a(k) > 0. For n odd, Sum_{k=1..n} a(k) = 0. - James Spahlinger, Oct 13 2013
|
|
LINKS
|
|
|
FORMULA
|
G.f.: -1/x + (1 - x)*Sum_{k>=0} x^(2^k-2)/(1 - x^(2^k)). - Ilya Gutkovskiy, Feb 28 2017
|
|
EXAMPLE
|
G.f. = 1 - x + 2*x^2 - 2*x^3 + x^4 - x^5 + 3*x^6 - 3*x^7 + x^8 - x^9 + ...
|
|
PROG
|
(PARI) {a(n) = my(A); if( n<0, 0, A = sum(k=0, length( binary(n+2)) - 1, x^(2^k) / (1 - x^(2^k)), x^3 * O(x^n)); polcoeff( (A * (1 - x) - x) / x^2, n))}; /* Michael Somos, May 11 2014 */
(Python)
def A094267(n): return (((m:=n>>1)&~(m+1)).bit_length()+1)*(-1 if n&1 else 1) # Chai Wah Wu, Jul 12 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|