OFFSET
0,3
COMMENTS
Let A be the Hessenberg n X n matrix defined by: A[1,j]=j mod 5, A[i,i]=1, A[i,i-1]=-1. Then, for n>=1, a(n)=det(A). - Milan Janjic, Jan 24 2010
LINKS
Shawn A. Broyles, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,1,-1).
FORMULA
G.f.: x*(1 + 2*x + 3*x^2 + 4*x^3)/((1-x^5)*(1-x)).
From Wesley Ivan Hurt, Jul 23 2016: (Start)
a(n) = a(n-5) - a(n-6) for n>5; a(n) = a(n-5) + 10 for n>4.
a(n) = 10 + Sum_{k=1..4} k*floor((n-k)/5). (End)
a(n) = ((n mod 5)^2 - 3*(n mod 5) + 4*n)/2. - Ammar Khatab, Aug 13 2020
MAPLE
seq(coeff(series(x*(1+2*x+3*x^2+4*x^3)/((1-x^5)*(1-x)), x, n+1), x, n), n = 0..70); # G. C. Greubel, Aug 31 2019
MATHEMATICA
Accumulate[Mod[Range[0, 70], 5]] (* or *) Accumulate[PadRight[{}, 70, {0, 1, 2, 3, 4}]] (* Harvey P. Dale, Nov 11 2016 *)
PROG
(PARI) a(n) = sum(k=0, n, k % 5); \\ Michel Marcus, Apr 28 2018
(MAGMA) I:=[0, 1, 3, 6, 10, 10]; [n le 6 select I[n] else Self(n-1) + Self(n-5) - Self(n-6): n in [1..71]]; // G. C. Greubel, Aug 31 2019
(Sage)
def A130483_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P(x*(1+2*x+3*x^2+4*x^3)/((1-x^5)*(1-x))).list()
A130483_list(70) # G. C. Greubel, Aug 31 2019
(GAP) a:=[0, 1, 3, 6, 10, 10];; for n in [7..71] do a[n]:=a[n-1]+a[n-5]-a[n-6]; od; a; # G. C. Greubel, Aug 31 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hieronymus Fischer, May 29 2007
STATUS
approved