|
|
A087204
|
|
Period 6: repeat [2, 1, -1, -2, -1, 1].
|
|
14
|
|
|
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.
Moebius transform is length 6 sequence [1, -2, -3, 0, 0, 6]. - Michael Somos, Oct 22 2006
Twice the real part of x^n, where x is either of the primitive 6th roots of unity. For the root with positive imaginary part, the imaginary part of x^n is i*A128834(n)*sqrt(3)/2. - Peter Munn, Apr 25 2022
|
|
REFERENCES
|
A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 176.
|
|
LINKS
|
|
|
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)).
Multiplicative with a(2^e) = -1, a(3^e) = -2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 12 2005
a(n) = a(-n) = -a(n-3) for all n in Z. - Michael Somos, Oct 22 2006
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
Dirichlet g.f.: zeta(s)*(1-2^(1-s)-3^(1-s)+6^(1-s)). - Amiram Eldar, Jan 01 2023
|
|
EXAMPLE
|
a(2) = -1 = a(1) - a(0) = 1 - 2 = ((1+sqrt(-3))/2)^2 + ((1-sqrt(-3))/2)^2 = -1 = -2/4 + 2*sqrt(-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
|
|
|
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 range(0, 102)] # Zerinvary Lajos, Apr 30 2009
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy,mult
|
|
AUTHOR
|
Nikolay V. Kosinov (kosinov(AT)unitron.com.ua), Oct 19 2003
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|