login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A001057 Canonical enumeration of integers: interleaved positive and negative integers with zero prepended. 36
0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, -6, 7, -7, 8, -8, 9, -9, 10, -10, 11, -11, 12, -12, 13, -13, 14, -14, 15, -15, 16, -16, 17, -17, 18, -18, 19, -19, 20, -20, 21, -21, 22, -22, 23, -23, 24, -24, 25, -25, 26, -26, 27, -27, 28, -28, 29, -29, 30, -30, 31, -31 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

Unsigned sequence (A008619) gives number of partitions of n in which the greatest part is 2. - Robert G. Wilson v, Jan 11 2002

Go forwards and backwards with increasing step sizes. - Daniele Parisse and Franco Virga (daniele.parisse(AT)eads.com), Jun 06 2005

The partial sums of the divergent series 1 - 2 + 3 - 4 + ... give this sequence. Euler summed it to 1/4 which was one of the first examples of summing divergent series. - Michael Somos May 22 2007

Contribution from Peter Luschny, Jul 12 2009: (Start)

The general formula for alternating sums of powers is in terms of the Swiss-Knife polynomials P(n,x) A153641 2^(-n-1)(P(n,1)-(-1)^k P(n,2k+1)). Thus

a(k) = 2^(-2)(P(1,1)-(-1)^k P(1,2k+1)). (End)

Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=-1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=4, a(n-3)=(-1)^(n-1)*coeff(charpoly(A,x),x). [From Milan Janjic, Jan 26 2010]

Cantor ordering of the integers producing a 1-1 and onto correspondence between the natural numbers and the integers showing that the set Z of integers has the same cardinality as the set N of natural numbers. The cardinal of N is the first transfinite cardinal aleph_null (or aleph_naught), which is the cardinality of a given infinite set if and only it is countably infinite (denumerable), i.e. it can be put in 1-1 and onto correspondence (with a proper Cantor ordering) with the natural numbers. [From Daniel Forgues, Jan 23 2010]

REFERENCES

G. Myerson and A. J. van der Poorten, Some problems concerning recurrence sequences, Amer. Math. Monthly, 102 (1995), 698-705.

LINKS

T. D. Noe, Table of n, a(n) for n=0..1000

G. Myerson and A. J. van der Poorten, Some problems concerning recurrence sequences, Amer. Math. Monthly, 102 (1995), 698-705.

O. E. Pol, Illustration of initial terms of A001057, A005132, A000217

Wikipedia, 1 - 2 + 3 - 4 + ...

FORMULA

Euler transform of [ -1, 2] is sequence a(n+1).

G.f.: x/((1+x)(1-x^2)). E.g.f.: (exp(x)-(1-2x)exp(-x))/4.

a(n)=1-2*a(n-1)-a(n-2); a(2n)=-n, a(2n+1)=n+1.

a(n)=-a(n-1)+a(n-2)+a(n-3). a(n)=(-1)^(n+1)*floor((n+1)/2).

a(1) = 1, a(n) = a(n-1)+n or a(n-1)-n whichever is closer to 0 on the number line. Or abs(a(n)) = min{abs(a(n-1)+n), abs(a(n-1)-n)}. - Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Jul 01 2003

a(n)=sum{k=0..n, k*(-1)^(k+1) } - Paul Barry, Aug 20 2003

a(n)=(1-(2n+1)*(-1)^n))/4 - Paul Barry, Feb 02 2004

a(0)=0; a(n) = (-1)^(n-1) * (n-|a(n-1)|) for n >= 1. - Rick L. Shepherd, Jul 14 2004

a(n)=a(n-1)-n*(-1)^n, a(0)=0; or a(n)=-a(n-1)+(1-(-1)^n)/2, a(0)=0. - Daniele Parisse and Franco Virga (daniele.parisse(AT)eads.com), Jun 06 2005

a(n) = ceiling(n/2) * (-1)^(n+1), n >= 0. - Franklin T. Adams-Watters, Nov 25 2011 (corrected by Daniel Forgues, Jul 21, 2012)

MAPLE

a := n -> (1-(-1)^n*(2*n+1))/4; [From Peter Luschny, Jul 12 2009]

MATHEMATICA

Join[{0}, Riffle[Range[35], -Range[35]]] (* From Harvey P. Dale, Sep 21 2011 *)

PROG

(PARI) a(n)=if(n%2, n\2+1, -n/2)

(Haskell)

a001057 n = (n' + m) * (-1) ^ (1 - m) where (n', m) = divMod n 2

a001057_list = 0 : concatMap (\x -> [x, -x]) [1..]

-- Reinhard Zumkeller, Apr 02 2012

CROSSREFS

A008619(n)=|a(n+1)|, A004526(n)=|a(n-1)|.

Cf. A166711, A166871. [From Jaume Oliver Lafont, Oct 30 2009]

Cf. A130472 (negation).

Cf. A142150 (partial sums), A010551 (partial products for n > 0).

Sequence in context: A127365 A168050 A065033 * A130472 A076938 A004526

Adjacent sequences:  A001054 A001055 A001056 * A001058 A001059 A001060

KEYWORD

sign,nice,core,easy

AUTHOR

N. J. A. Sloane.

EXTENSIONS

Thanks to Michael Somos for helpful comments.

Name edited by Franklin T. Adams-Watters, Jan 30 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified May 25 04:27 EDT 2013. Contains 225638 sequences.