OFFSET
1,8
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,3,0,0,1,0,0,1).
FORMULA
a(n)= Trib(2*q-3)+Trib(2*q-1) if r=0; Trib(2*q-2)+Trib(2*q-1) if r=1; Trib(2*q) if r=2 where q=[(n-1)/3], r=n-1 (mod 3) and Trib is the tribonacci sequence (A000073) with Trib(-3)=0, Trib(-2)=-1, Trib(-1)=1. G.f.: (x^8-2*x^7+3*x^6-x^5+2*x^3-1)/(x^9+x^6+3*x^3-1). Recurrence: a(n)=3*a(n-3)+a(n-6)+a(n-9), n >= 10.
EXAMPLE
a(10)=5 because {0, 5, 14, 31}->{5, 9, 17, 31}->{4, 8, 14, 26}->{4, 6, 12, 22}->{2, 6, 10, 18}->{4, 4, 8, 16}->{0, 4, 8, 12}->{4, 4, 4, 12}->{0, 0, 8, 8}->{0, 8, 0, 8}->{8, 8, 8, 8} ('a'=5 in the first 4-tuple and there is no quadruple with a+b<=c <= 31 and 10 steps).
MATHEMATICA
LinearRecurrence[{0, 0, 3, 0, 0, 1, 0, 0, 1}, {1, 0, 0, 1, 0, 1, 1, 2, 2}, 60] (* Harvey P. Dale, Jun 13 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Better description, more terms, formula, etc. from Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Jun 24 2001
Minor edits from Michael B. Porter, Feb 03 2010
STATUS
approved