login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A094267 First differences of A001511. 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, 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
a(n) = (-1)^n * A050603(n).
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)=(-1)^n*valuation(n+2-n%2, 2) \\ Charles R Greathouse IV, Oct 14 2013
(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
Absolute values give A050603. Cf. A001511, A005187.
Sequence in context: A152805 A064894 A003638 * A136480 A050603 A286554
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Jun 03 2004
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 14 23:27 EDT 2024. Contains 370833 sequences. (Running on oeis4.)