OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,-1,1,-1).
FORMULA
a(n+1) == 2*a(n) mod 11.
a(n) = (1/2 - (7*sqrt(5)/10))*cos(Pi*n/5) + (sqrt(2)/10)*(12*sqrt(5+sqrt(5))+7*sqrt(5-sqrt(5)))*sin(Pi*n/5) + (1/2 + (7*sqrt(5)/10))*cos(3*Pi*n/5) - (sqrt(2)/10)*(12*sqrt(5-sqrt(5)) - 7*sqrt(5+sqrt(5)))*sin(3*Pi*n/5). - Richard Choulet, Jan 04 2008
O.g.f.: (5*x^3+3*x^2+x+1)/(x^4-x^3+x^2-x+1). - R. J. Mathar, Jan 07 2008
a(n) = a(n-1)-a(n-2)+a(n-3)-a(n-4) for n>3. - Wesley Ivan Hurt, Sep 19 2015
MAPLE
A135447 := proc(n) op((n mod 10)+1, [1, 2, 4, 8, 5, -1, -2, -4, -8, -5]) ; end: seq(A135447(n), n=0..150) ; # R. J. Mathar, Feb 07 2009
MATHEMATICA
PadRight[{}, 100, {1, 2, 4, 8, 5, -1, -2, -4, -8, -5}] (* Vincenzo Librandi, Sep 19 2015 *)
LinearRecurrence[{1, -1, 1, -1}, {1, 2, 4, 8}, 100] (* Harvey P. Dale, Jun 03 2023 *)
PROG
(PARI) a(n)=[1, 2, 4, 8, 5, -1, -2, -4, -8, -5][n%10+1] \\ Charles R Greathouse IV, Jun 02 2011
(Magma) &cat[[1, 2, 4, 8, 5, -1, -2, -4, -8, -5]: n in [0..10]]; // Vincenzo Librandi, Sep 19 2015
CROSSREFS
KEYWORD
sign,easy,less
AUTHOR
Paul Curtz, Dec 14 2007
EXTENSIONS
More periods from R. J. Mathar, Feb 07 2009
STATUS
approved