login
A141685
a(1) = 1, a(n) = Sum_{k=1..n} (k mod 3) * a(n-k) for n >= 2.
1
1, 1, 3, 5, 12, 25, 54, 116, 249, 535, 1149, 2468, 5301, 11386, 24456, 52529, 112827, 242341, 520524, 1118033, 2401422, 5158012, 11078889, 23796335, 51112125, 109783684, 235804269, 506483762, 1087875984, 2336647777, 5018883507
OFFSET
1,3
COMMENTS
Lim_{n -> infinity} a(n+1)/a(n) = 2.1478990357047874.
FORMULA
a(n) = Sum_{k=1..n} (k mod 3) * a(n-k).
If p[i] = modp(i,3) and if A is Hessenberg matrix of order n defined by: A[i,j] = p[j-i+1], (i<=j), A[i,j] = -1, (i= j+1), and A[i,j]=0 otherwise. Then, for n >= 1, a(n+1) = det A. - Milan Janjic, May 02 2010
G.f.: x*(1-x)*(1+x+x^2)/(1-x-2*x^2-x^3). - Colin Barker, Feb 01 2012
MATHEMATICA
a[1]=1; a[n_]:= Sum[Mod[k, 3]*a[n-k], {k, 1, n}]; Table[a[n], {n, 1, 35}]
Join[{1}, LinearRecurrence[{1, 2, 1}, {1, 3, 5}, 35]] (* G. C. Greubel, Apr 06 2019 *)
PROG
(PARI) my(x='x+O('x^35)); Vec(x*(1-x^3)/(1-x-2*x^2-x^3)) \\ G. C. Greubel, Apr 06 2019
(Magma) I:=[1, 3, 5]; [1] cat [n le 3 select I[n] else Self(n-1) +2*Self(n -2)+Self(n-3): n in [1..35]]; // G. C. Greubel, Apr 06 2019
(Sage) a=(x*(1-x^3)/(1-x-2*x^2-x^3)).series(x, 35).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Apr 06 2019
CROSSREFS
Sequence in context: A030270 A129757 A135019 * A017921 A280000 A241097
KEYWORD
nonn
AUTHOR
STATUS
approved