This site is supported by donations to The OEIS Foundation.

Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 5000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A087204 Period 6: repeat [2, 1, -1, -2, -1, 1]. 9
 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, 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 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,1 COMMENTS Satisfies (a(n))^2 = a(2n) + 2. Shifted differences of itself. Multiplicative with a(2^e) = -1, a(3^e) = -2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 12 2005 Moebius transform is length 6 sequence [1, -2, -3, 0, 0, 6]. - Michael Somos, Oct 22 2006 REFERENCES A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 176. LINKS Tanya Khovanova, Recursive Sequences Wikipedia, Lucas sequence Index entries for linear recurrences with constant coefficients, signature (1,-1). FORMULA a(n) = a(n-1) - a(n-2), starting with a(0) = 2 and a(1) = 1. G.f.: (2-x)/(1-x+x^2). a(n) = Sum_{k>=0} (-1)^k*n/(n-k)*C(n-k, k). a(n) = (1/2)*((-1)^floor(n/3) + 2*(-1)^floor((n+1)/3) + (-1)^floor((n+2)/3)). a(n) = -(1/6)*((n mod 6)+2*((n+1) mod 6)+((n+2) mod 6)-((n+3) mod 6)-2*((n+4) mod 6)-((n+5) mod 6)). - Paolo P. Lava, Oct 09 2006 a(n) = a(-n) = -a(n-3) for all n in Z. - Michael Somos, Oct 22 2006 E.g.f. 2*exp(x/2)*cos(sqrt(3)*x/2). - Sergei N. Gladkovskii, Aug 12 2012 a(n) = r^n + s^n, with r=(1+i*sqrt(3))/2 and s=(1-i*sqrt(3))/2 the roots of 1-x+x^2. - Ralf Stephan, Jul 19 2013 a(n) = 2*cos(n*Pi/3). - Wesley Ivan Hurt, Jun 19 2016 EXAMPLE a(2) = -1 = a(1) - a(0) = 1 - 2 = ((1+sqrt(-3))/2)^2 + ((1-sqrt(-3))/2)^2 = -1 = -2/4 + 2sqrt(-3)/4 - 2/4 -2 sqrt(-3)/4 = -1. G.f. = 2 + x - x^2 - 2*x^3 - x^4 + x^5 + 2*x^6 + x^7 - x^8 - 2*x^9 - x^10 + ... MAPLE A087204:=n->[2, 1, -1, -2, -1, 1][(n mod 6)+1]: seq(A087204(n), n=0..100); # Wesley Ivan Hurt, Jun 19 2016 MATHEMATICA PadLeft[{}, 108, {2, 1, -1, -2, -1, 1}] (* Harvey P. Dale, Sep 11 2011 *) a[ n_] := {1, -1, -2, -1, 1, 2}[[Mod[n, 6, 1]]]; (* Michael Somos, Jan 29 2015 *) a[ n_] := 2 Re[ Exp[ Pi I n / 3]]; (* Michael Somos, Mar 29 2015 *) PROG (PARI) {a(n) = [2, 1, -1, -2, -1, 1][n%6 + 1]}; /* Michael Somos, Oct 22 2006 */ (Sage) [lucas_number2(n, 1, 1) for n in xrange(0, 102)] # Zerinvary Lajos, Apr 30 2009 (MAGMA) &cat[[2, 1, -1, -2, -1, 1]^^20]; // Wesley Ivan Hurt, Jun 19 2016 CROSSREFS Essentially the same as A057079 and A100051. Pairwise sums of A010892. Sequence in context: A131556 A107751 A132367 * A101825 A177702 A131534 Adjacent sequences:  A087201 A087202 A087203 * A087205 A087206 A087207 KEYWORD sign,easy,mult AUTHOR Nikolay V. Kosinov (kosinov(AT)unitron.com.ua), Oct 19 2003 EXTENSIONS Edited by Ralf Stephan, Feb 04 2005 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.