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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A131713 Period 3: repeat [1, -2, 1]. 8
1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1, 1, -2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

Second differences of A131534. Binomial transform of 1, -3, 6, -9, 9, 0 ..., A057083 signed.

Nonsimple continued fraction expansion of sqrt(2)-1 = 0.414213562... - R. J. Mathar, Mar 08 2012

LINKS

Table of n, a(n) for n=0..77.

Index entries for linear recurrences with constant coefficients, signature (-1,-1).

FORMULA

a(n) = b(2*n + 1) where b(n) is multiplicative with b(2^n) = 0^n, b(3^n) = 3 * 0^n - 2, b(p^n) = 1 if p > 3. - Michael Somos, Jan 02 2011

a(n) = {-[(n+1) mod 3]+[(n+2) mod 3]}. - Paolo P. Lava, Oct 02 2007

G.f.: (1-x)/(x^2+x+1). - R. J. Mathar, Nov 14 2007

a(n) = 2*cos((2n+1)*Pi/3). [Jaume Oliver Lafont, Nov 23 2008]

a(n) = 1/3*(-1/2-(1/2*I)*sqrt(3))^(-2)*(-1/2-(1/2*I)*sqrt(3))^n+1/3*(-1/2+(1/2*I)*sqrt(3))^(-2)*(-1/2+(1/2*I)*sqrt(3))^n+1/3*(-1/2-(1/2*I)*sqrt(3))^n+1/3*(-1/2 +(1/2*I)*sqrt(3))^n-2/3*(-1/2-(1/2*I)*sqrt(3))^(-1)*(-1/2-(1/2*I)*sqrt(3))^n-2/3*(-1/2+(1/2*I)*sqrt(3))^(-1)*(-1/2+(1/2*I)*sqrt(3))^n, with I=sqrt(-1). [Paolo P. Lava, Nov 27 2008]

a(n) = A117188(2*n). - R. J. Mathar, Jun 13 2011

a(n) + a(n-1) + a(n-2) = 0 for n>1, a(n) = a(n-3) for n>2. - Wesley Ivan Hurt, Jul 01 2016

MAPLE

seq(op([1, -2, 1]), n=0..50); # Wesley Ivan Hurt, Jul 01 2016

MATHEMATICA

f[n_] := If[ Mod[n, 3] == 1, -2, 1]; Array[f, 105, 0]

CoefficientList[Series[(1 - x)/(1 + x + x^2), {x, 0, 104}], x]

PadRight[{}, 120, {1, -2, 1}] (* Harvey P. Dale, Jan 25 2014 *)

PROG

(PARI) a(n)=[1, -2, 1][1+n%3] \\ Jaume Oliver Lafont, Mar 24 2009

(PARI) a(n)=1-3*(n%3==1) \\ Jaume Oliver Lafont, Mar 24 2009

(MAGMA) &cat [[1, -2, 1]^^30]; // Wesley Ivan Hurt, Jul 01 2016

CROSSREFS

Cf. A057083, A061347, A131534.

Sequence in context: A100051 A281727 A122876 * A100063 A057079 A132419

Adjacent sequences:  A131710 A131711 A131712 * A131714 A131715 A131716

KEYWORD

sign,easy,less

AUTHOR

Paul Curtz, Sep 14 2007

EXTENSIONS

Corrected and extended by Michael Somos, Jan 02 2011

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified May 20 13:34 EDT 2018. Contains 304338 sequences. (Running on oeis4.)