|
|
A061347
|
|
Period 3: repeat [1, 1, -2].
|
|
61
|
|
|
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, -2, 1, 1, -2, 1, 1, -2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
WARNING: It is unclear whether this sequence should start at offset 1 (as written) or offset 0 (in analogy to many similar sequences, which seems to be assumed in many of the given formulas).
The unsigned version, with g.f. (1 + x + 2*x^2)/(1 - x^3), has a(n) = 4/3 -cos(2*Pi*n/3)/3 - sqrt(3)*sin(2*Pi*n/3)/3 = gcd(Fib(n+4), Fib(n+1)). - Paul Barry, Apr 02 2004
From the Taylor expansion of log(1 + x + x^2) at x = 1, Sum_{k > 0} a(k)/k = log(3) = A002391. This is case n = 3 of the general expression Sum_{k > 0} (1-n*!(k mod n))/k = log(n). - Jaume Oliver Lafont, Oct 16 2009
If used with offset zero, a non-simple continued fraction representation of 2+sqrt(2). - R. J. Mathar, Mar 08 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, 1, -2), c = -2, p = 4 and q = 60 for this sequence. - Hieronymus Fischer, Jan 04 2013
|
|
LINKS
|
|
|
FORMULA
|
With offset zero, a(n) = A057079(2n). a(n) = -a(n-1) - a(n-2) with a(0) = a(1) = 1.
From Mario Catalani (mario.catalani(AT)unito.it), Jan 07 2003: (Start)
G.f.: x*(1 + 2*x)/(1 + x + x^2).
a(n) = (-1)^floor(2n/3) + ((-1)^floor((2n-1)/3) + (-1)^floor((2n+1)/3))/2. (End)
Dirichlet g.f.: zeta(s)*(1-1/3^(s-1)). - R. J. Mathar, Feb 09 2011
a(n) = n * Sum_{k=1..n} binomial(k,n-k)/k*(-1)^(k+1). - Dmitry Kruchinin, Jun 03 2011
a(n) = (-1)^n*hypergeom([-n/2-1, -n/2-3/2], [-n-2], 4). - Peter Luschny, Dec 17 2016
|
|
EXAMPLE
|
G.f.: x + x^2 - 2*x^3 + x^4 + x^5 - 2*x^6 + x^7 + x^8 - 2*x^9 + ... - Michael Somos, Nov 27 2019
|
|
MAPLE
|
|
|
MATHEMATICA
|
PadRight[{}, 90, {1, 1, -2}] (* After Harvey P. Dale, or *)
CoefficientList[ Series[(2x + 1)/(x^2 + x + 1), {x, 0, 89}], x] (* or *)
|
|
PROG
|
(Sage)
x, y = -1, -1
while True:
yield -x
x, y = y, -x -y
(GAP) Flat(List([1..50], n->[1, 1, -2])); # Muniru A Asiru, Aug 02 2018
|
|
CROSSREFS
|
Apart from signs, same as A057079 (also bin. Transf), A100063. Cf. A000045, A010892 for the rules a(n) = a(n - 1) + a(n - 2), a(n) = a(n - 1) - a(n - 2). a(n) = - a(n - 1) + a(n - 2) gives a signed version of Fibonacci numbers.
Alternating row sums of A130777: repeat(1,-2,1).
|
|
KEYWORD
|
sign,easy,mult
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|