login
A175922
Period 5: repeat [1, 1, 2, -1, 2].
2
1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2, 1, 1, 2, -1, 2
OFFSET
1,3
FORMULA
a(n) = 1 + (2/5)*(cos(2*n*Pi/5) + cos(4*n*Pi/5) - 2*cos(2*(n+1)*Pi/5) - sin((4*n+3)*Pi/10) + 2*sin((8*n+3)*Pi/10) + sin((8*n+1)*Pi/10)). - Wesley Ivan Hurt, Sep 27 2018
G.f.: x*(1 + x + 2*x^2 - x^3 + 2*x^4) / (1 - x^5). - Vincenzo Librandi, Sep 28 2018
a(n) = a(n-5). - Wesley Ivan Hurt, Jun 25 2022
MAPLE
seq(op([1, 1, 2, -1, 2]), n=1..30); # Muniru A Asiru, Sep 28 2018
MATHEMATICA
PadRight[{}, 100, {1, 1, 2, -1, 2}] (* Vincenzo Librandi, Sep 28 2018 *)
PROG
(PARI) a(n)=[2, 1, 1, 2, -1][n%5+1] \\ Charles R Greathouse IV, Jul 17 2016
(Magma) &cat[[1, 1, 2, -1, 2]^^20]; // Vincenzo Librandi, Sep 28 2018
(GAP) Flat(List([1..30], n->[1, 1, 2, -1, 2])); # Muniru A Asiru, Sep 28 2018
CROSSREFS
KEYWORD
sign,easy,less
AUTHOR
Jaroslav Krizek, Oct 17 2010
EXTENSIONS
Edited by Joerg Arndt, Sep 16 2013
STATUS
approved