|
|
A057079
|
|
Periodic sequence: repeat [1,2,1,-1,-2,-1]; expansion of (1+x)/(1-x+x^2).
|
|
67
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Hexaperiodic sequence identical to its third differences. - Paul Curtz, Dec 13 2007
Non-simple continued fraction expansion of 1 = 1+1/(2+1/(1+1/(-1+...))). - R. J. Mathar, Mar 08 2012
Pisano period lengths: 1, 3, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, ... - R. J. Mathar, Aug 10 2012
Periodic sequences of this type can be also calculated by a(n) = c + floor(q/(p^m-1)*p^n) mod p, where c is a constant, q is the number representing the periodic digit pattern and m is the period length. c, p and q can be calculated as follows: Let D be the array representing the number pattern to be repeated, m = size of D, max = maximum value of elements in D, min = minimum value of elements in D. Than c := min, p := max - min + 1 and q := p^m*sum_{i=1..m} (D(i)-min)/p^i. Example: D = (1, 2, 1, -1, -2, -1), c = -2, m = 6, p = 5 and q = 12276 for this sequence. - Hieronymus Fischer, Jan 04 2013
|
|
LINKS
|
|
|
FORMULA
|
a(n) = S(n, 1) + S(n-1, 1) = S(2*n, sqrt(3)); S(n, x) := U(n, x/2), Chebyshev polynomials of 2nd kind, A049310. S(n, 1) = A010892(n).
a(n) = 2*cos((n-1)*Pi/3) = a(n-1) - a(n-2) = -a(n-3) = a(n-6) = (A022003(n+1)+1)*(-1)^floor(n/3). Unsigned a(n) = 4 - a(n-1) - a(n-2). - Henry Bottomley, Mar 29 2001
a(n) = (-1)^floor(n/3) + ((-1)^floor((n-1)/3) + (-1)^floor((n+1)/3))/2. - Mario Catalani (mario.catalani(AT)unito.it), Jan 07 2003
a(n) = (1/2 - sqrt(3)*i/2)^(n-1) + (1/2 + sqrt(3)*i/2)^(n-1) = cos(Pi*n/3) + sqrt(3)*sin(Pi*n/3). - Paul Barry, Mar 15 2004
The period 3 sequence (2, -1, -1, ...) has a(n) = 2*cos(2*Pi*n/3) = (-1/2 - sqrt(3)*i/2)^n + (-1/2 + sqrt(3)*i/2)^n. - Paul Barry, Mar 15 2004
Euler transform of length 6 sequence [2, -2, -1, 0, 0, 1]. - Michael Somos, Jul 14 2006
G.f.: (1 + x) / (1 - x + x^2) = (1 - x^2)^2 * (1 - x^3) / ((1 - x)^2 * (1 - x^6)). a(n) = a(2-n) for all n in Z. - Michael Somos, Jul 14 2006
E.g.f.: E(x) = S(0), S(k) = 1 + 2*x/(6*k+1 - x*(6*k+1)/(4*(3*k+1) + x + 4*x*(3*k+1)/(6*k + 3 - x - x*(6*k+3)/(3*k + 2 + x - x*(3*k+2)/(12*k + 10 + x - x*(12*k+10)/(x - (6*k+6)/S(k+1))))))); (continued fraction). - Sergei N. Gladkovskii, Dec 14 2011
a(n) = ( (1+i*sqrt(3))^(n-1) + (1-i*sqrt(3))^(n-1) )/2^(n-1), where i=sqrt(-1). - Bruno Berselli, Dec 01 2014
a(n) = hypergeom([-n/2-2, -n/2-5/2], [-n-4], 4). - Peter Luschny, Dec 17 2016
G.f.: 1 / (1 - 2*x / (1 + 3*x / (2 - x))). - Michael Somos, Dec 29 2016
a(n) = (2*n+1)*(Sum_{k=0..n} ((-1)^k/(2*k+1))*binomial(n+k,2*k)) for n >= 0. - Werner Schulte, Jul 10 2017
Sum_{n>=0} (a(n)/(2*n+1))*x^(2*n+1) = arctan(x/(1-x^2)) for -1 < x < 1. - Werner Schulte, Jul 10 2017
|
|
EXAMPLE
|
G.f. = 1 + 2*x + x^2 - x^3 - 2*x^4 - x^5 + x^6 + 2*x^7 + x^8 - x^9 - 2*x^10 + x^11 + ...
|
|
MAPLE
|
|
|
MATHEMATICA
|
a[n_] := {1, 2, 1, -1, -2, -1}[[Mod[n, 6] + 1]]; Array[a, 100, 0] (* Jean-François Alcover, Jul 05 2013 *)
CoefficientList[Series[(1 + x)/(1 - x + x^2), {x, 0, 71}], x] (* Michael De Vlieger, Jul 10 2017 *)
|
|
PROG
|
(PARI) {a(n) = [1, 2, 1, -1, -2, -1][n%6 + 1]}; /* Michael Somos, Jul 14 2006 */
(PARI) {a(n) = if( n<0, n = 2-n); polcoeff( (1 + x) / (1 - x + x^2) + x * O(x^n), n)}; /* Michael Somos, Jul 14 2006 */
(PARI) a(n)=2^(n%3%2)*(-1)^(n\3) \\ Tani Akinari, Aug 15 2013
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|