OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
G.f.: x*(1+x+2*x^2+x^3+2*x^4) / ( (1+x)*(x^2+1)*(x-1)^2 ). - R. J. Mathar, Oct 08 2011
From Wesley Ivan Hurt, May 20 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (14*n - 11 - 3*i^(2*n) - (1+i)*i^(-n-1) - (1-i)*i^(n+1))/8 where i=sqrt(-1).
MAPLE
A047380:=n->(14*n-11-3*I^(2*n)-(1+I)*I^(-n-1)-(1-I)*I^(n+1))/8: seq(A047380(n), n=1..100); # Wesley Ivan Hurt, May 20 2016
MATHEMATICA
Table[(14n-11-3I^(2n)-(1+I)I^(-n-1)-(1-I)I^(n+1))/8, {n, 80}] (* Wesley Ivan Hurt, May 20 2016 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {1, 2, 4, 5, 8}, 100] (* Harvey P. Dale, Jun 05 2016 *)
PROG
(PARI) a(n)=(n-1)\4*7+[5, 1, 2, 4][n%4+1] \\ Charles R Greathouse IV, Jun 11 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved