OFFSET
0,4
COMMENTS
Previous name: First entry of the vector (M^n)w, where M is the 7x7 matrix [[0,1,0,0,0,0,0], [0,0,1,0,0,0,0], [0,0,0,1,0,0,0], [0,0,0,0,1,0,0], [0,0,0,0,0,1,0], [0,0,0,0,0,0,1], [1,0,1,0,1,0,1]] and w is the column vector [0,1,1,2,3,5,8].
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,0,1,0,1).
FORMULA
a(n) = a(n-1) + a(n-3) + a(n-5) + a(n-7).
G.f.: (x + x^3 + x^5)/(1 - x - x^3 - x^5 - x^7). - Joel B. Lewis, Nov 14 2012
MAPLE
with(linalg): M:=matrix(7, 7, [0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1]):
w[0]:=matrix(7, 1, [0, 1, 1, 2, 3, 5, 8]): for n from 1 to 40 do
w[n]:=multiply(M, w[n-1]) od: seq(w[n][1, 1], n=0..40);
MATHEMATICA
M = {{0, 1, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 1}, {1, 0, 1, 0, 1, 0, 1}};
w[1] = {0, 1, 1, 2, 3, 5, 8}; w[n_]:= w[n]= M.w[n-1];
A117761[n_]:= w[n][[1]];
Table[A117761[n], {n, 50}]
LinearRecurrence[{1, 0, 1, 0, 1, 0, 1}, {0, 1, 1, 2, 3, 5, 8}, 50] (* Harvey P. Dale, Oct 06 2017 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Integers(), 50); [0] cat Coefficients(R!( x*(1+x^2+x^4)/(1-x-x^3-x^5-x^7) )); // G. C. Greubel, Jul 21 2023
(SageMath)
@CachedFunction
def a(n): # a = A117761
if n<8: return fibonacci(n) - int(n==7)
else: return a(n-1) + a(n-3) + a(n-5) + a(n-7)
[a(n) for n in range(51)] # G. C. Greubel, Jul 21 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Apr 14 2006
EXTENSIONS
Edited by N. J. A. Sloane, Apr 30 2006
New name from Joel B. Lewis, Nov 14 2012
STATUS
approved