login
A135169
Period 4: repeat [1, 5, 9, 5].
0
1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5, 9, 5, 1, 5
OFFSET
0,2
FORMULA
From R. J. Mathar, Feb 19 2008: (Start)
G.f.: -4/(x^2+1) - 5/(x-1).
a(n) = 5 - 4*A056594(n).
a(n) = a(n-4) for n>3. (End)
From Wesley Ivan Hurt, Jul 08 2016: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) for n>2.
a(n) = 5 - 4*cos(n*Pi/2). (End)
E.g.f.: 5*exp(x) - 4*cos(x). - G. C. Greubel, Sep 30 2016
MAPLE
seq(op([1, 5, 9, 5]), n=0..50); # Wesley Ivan Hurt, Jul 08 2016
MATHEMATICA
PadRight[{}, 100, {1, 5, 9, 5}] (* Wesley Ivan Hurt, Jul 08 2016 *)
PROG
(Magma) &cat [[1, 5, 9, 5]^^30]; // Wesley Ivan Hurt, Jul 08 2016
(PARI) a(n)=([0, 1, 0; 0, 0, 1; 1, -1, 1]^n*[1; 5; 9])[1, 1] \\ Charles R Greathouse IV, Sep 30 2016
CROSSREFS
Cf. A056594.
Sequence in context: A201325 A372285 A359485 * A335840 A021172 A094880
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Feb 14 2008
STATUS
approved