A175922 Period 5: repeat [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, 1, 1, 2, -1, 2
Offset: 1
Links
- Muniru A Asiru, Table of n, a(n) for n = 1..2000
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,1).
Programs
-
GAP
Flat(List([1..30],n->[1,1,2,-1,2])); # Muniru A Asiru, Sep 28 2018
-
Magma
&cat[[1, 1, 2, -1, 2]^^20]; // Vincenzo Librandi, Sep 28 2018
-
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 *)
-
PARI
a(n)=[2,1,1,2,-1][n%5+1] \\ Charles R Greathouse IV, Jul 17 2016
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
Extensions
Edited by Joerg Arndt, Sep 16 2013