login
A125301
a(3n) = n, a(3n+1) = (n+2)*a(3n), a(3n+2) = (n+2)*a(3n+1).
1
0, 0, 0, 1, 3, 9, 2, 8, 32, 3, 15, 75, 4, 24, 144, 5, 35, 245, 6, 48, 384, 7, 63, 567, 8, 80, 800, 9, 99, 1089, 10, 120, 1440, 11, 143, 1859, 12, 168, 2352, 13, 195, 2925, 14, 224, 3584, 15, 255, 4335, 16, 288, 5184, 17, 323, 6137, 18, 360, 7200, 19, 399, 8379, 20
OFFSET
0,5
COMMENTS
From a competency test.
FORMULA
From Colin Barker, Jan 24 2017: (Start)
a(n) = 4*a(n-3) - 6*a(n-6) + 4*a(n-9) - a(n-12) for n>11.
G.f.: x^3*(1 + 3*x + 9*x^2 - 2*x^3 - 4*x^4 - 4*x^5 + x^6 + x^7 + x^8) / ((1 - x)^4*(1 + x + x^2)^4).
(End)
MAPLE
a:=proc(n): if n mod 3=0 then n/3 elif n mod 3 = 1 then (n+5)*a(n-1)/3 else (n+4)*a(n-1)/3 fi end: seq(a(n), n=0..75); # Emeric Deutsch, Jan 01 2007
MATHEMATICA
LinearRecurrence[{0, 0, 4, 0, 0, -6, 0, 0, 4, 0, 0, -1}, {0, 0, 0, 1, 3, 9, 2, 8, 32, 3, 15, 75}, 70] (* Harvey P. Dale, Jul 31 2018 *)
PROG
(PARI) concat(vector(3), Vec(x^3*(1 + 3*x + 9*x^2 - 2*x^3 - 4*x^4 - 4*x^5 + x^6 + x^7 + x^8) / ((1 - x)^4*(1 + x + x^2)^4) + O(x^100))) \\ Colin Barker, Jan 24 2017
CROSSREFS
Sequence in context: A348371 A354129 A060956 * A347214 A263559 A262343
KEYWORD
nonn,easy
AUTHOR
Trent Stratton (trent.stratton(AT)gov.bc.ca), Dec 08 2006
EXTENSIONS
Solution from N. J. A. Sloane, Dec 08 2006
More terms from Emeric Deutsch, Jan 01 2007
STATUS
approved