OFFSET
0,10
COMMENTS
Number of partitions of n into parts 3, 5, and 9. - David Neil McGrath, Feb 14 2015
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,1,0,1,0,0,-1,1,0,0,-1,0,-1,0,0,1).
FORMULA
a(n) = floor((n^2+17*n+177)/270 +([19, -17, -5]/81 +(floor(n/3)+1)*[1, -1, 0]/9)[(n mod 3)+1]). - Tani Akinari, May 23 2014
a(-17 - n) = a(n). - Michael Somos, May 23 2014
a(n) = a(n-3)+a(n-5)-a(n-8)+a(n-9)-a(n-12)-a(n-14)+a(n-17). - David Neil McGrath, Feb 14 2015
EXAMPLE
G.f. = 1 + x^3 + x^5 + x^6 + x^8 + 2*x^9 + x^10 + x^11 + 2*x^12 + x^13 + 2*x^14 + ...
There are 4 partitions of n=18 into parts 3, 5, and 9: (99), (9333), (5553), and (333333). - David Neil McGrath, Feb 14 2015
MAPLE
S:= series(1/(1-x^3)/(1-x^5)/(1-x^9), x, 1001):
seq(coeff(S, x, i), i=0..1000); # Robert Israel, Mar 24 2015
MATHEMATICA
a[ n_] := With[{m = Mod[n - 1, 3]}, Quotient[n^2 + (10 m + 7) n + (m + 1) 100, 270]]; (* Michael Somos, May 23 2014 *)
a[ n_] := With[{m = If[n < 0, -17 - n, n]}, SeriesCoefficient[ 1 / ((1 - x^3) (1 - x^5) (1 - x^9)), {x, 0, m}]]; (* Michael Somos, May 23 2014 *)
CoefficientList[Series[1 / ((1 - x^3) (1 - x^5) (1 - x^9)), {x, 0, 100}], x] (* Vincenzo Librandi, Mar 25 2015 *)
LinearRecurrence[{0, 0, 1, 0, 1, 0, 0, -1, 1, 0, 0, -1, 0, -1, 0, 0, 1}, {1, 0, 0, 1, 0, 1, 1, 0, 1, 2, 1, 1, 2, 1, 2, 3, 1}, 80] (* Harvey P. Dale, Dec 27 2021 *)
PROG
(PARI) a(n)=floor((n^2+17*n+177)/270+([19, -17, -5]/81+(n\3+1)*[1, -1, 0]/9)[n%3+1]) \\ Tani Akinari, May 23 2014
(PARI) {a(n) = my(m = (n-1)%3); (n^2 + (10*m + 7)*n + (m + 1)*100) \ 270}; /* Michael Somos, May 23 2014 */
(PARI) {a(n) = if( n<0, n = -17 - n); polcoeff( 1 / ((1 - x^3) * (1 - x^5) * (1 - x^9)) + x * O(x^n), n)}; /* Michael Somos, May 23 2014 */
(PARI) Vec(1/(-x^17+x^14+x^12-x^9+x^8-x^5-x^3+1) + O(x^100)) \\ Colin Barker, Feb 14 2015
(Magma) I:=[1, 0, 0, 1, 0, 1, 1, 0, 1, 2, 1, 1, 2, 1, 2, 3, 1]; [n le 17 select I[n] else Self(n-3)+Self(n-5)-Self(n-8)+Self(n-9)-Self(n-12)-Self(n-14)+Self(n-17): n in [1..100]]; // Vincenzo Librandi, Mar 25 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved