login
A079757
Periodic sequence 1, 0, -2, 3, -2, 0, ...
4
1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0, 1, 0, -2, 3, -2, 0
OFFSET
0,3
FORMULA
a(n) = A057079(2*n+1) - (-1)^floor((2*n+1)/2).
G.f.: (1+2*x)/(1+2*x+2*x^2+x^3).
a(n) = -2*a(n-1) - 2*a(n-2) - a(n-3).
a(n) = |Real(2*(sqrt(3/4)*i - 1/2)^n - (-1)^n )|, where i = sqrt(-1). - Ralf Stephan, Mar 07 2003
MATHEMATICA
PadRight[{}, 120, {1, 0, -2, 3, -2, 0}] (* G. C. Greubel, Mar 27 2024 *)
PROG
(Magma) &cat[[1, 0, -2, 3, -2, 0]: n in [0..20]]; // G. C. Greubel, Mar 27 2024
(SageMath)
def A079757(n): return [1, 0, -2, 3, -2, 0][n%6]
[A079757(n) for n in range(121)] # G. C. Greubel, Mar 27 2024
CROSSREFS
Cf. A057079.
Sequence in context: A071484 A372706 A100219 * A071493 A289813 A050075
KEYWORD
easy,sign
AUTHOR
Mario Catalani (mario.catalani(AT)unito.it), Jan 10 2003
STATUS
approved