OFFSET
1,18
COMMENTS
Also number of partitions of n such that if k is the largest part, then k occurs exactly once and integers from 1 to k-1 occur a positive multiple of 3 times. Example: a(18)=2 because we have [3,2,2,2,1,1,1,1,1,1,1,1,1] and [3,2,2,2,2,2,2,1,1,1]. - Emeric Deutsch, Apr 18 2006
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
FORMULA
G.f.: x*Product_{k>=1} (1+x^(1+3k)). - Emeric Deutsch, Apr 18 2006
a(n) ~ exp(Pi*sqrt(n)/3) / (2^(7/3) * sqrt(3) * n^(3/4)). - Vaclav Kotesovec, Aug 30 2015
G.f.: Sum_{k>=1} x^(k*(3*k - 1)/2) / Product_{j=1..k-1} (1 - x^(3*j)). - Ilya Gutkovskiy, Nov 28 2020
EXAMPLE
For a(24), we have 19+4+1, 16+7+1, 13+10+1, so a(24)=3.
MAPLE
g:=x*product(1+x^(1+3*k), k=1..25): gser:=series(g, x=0, 70): seq(coeff(gser, x, n), n=1..51); # Emeric Deutsch, Apr 18 2006
# second Maple program
b:= proc(n, i) option remember;
`if`(n=0, 1, `if`(i<2, 0, b(n, i-3)+`if`(i>n, 0, b(n-i, i-3))))
end:
a:= n-> b(n-1, iquo(n, 3)*3+1):
seq (a(n), n=1..100); # Alois P. Heinz, May 01 2012
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i<2, 0, b[n, i-3] + If[i>n, 0, b[n-i, i-3]]]]; a[n_] := b[n-1, Quotient[n, 3]*3+1]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, May 13 2015, after Alois P. Heinz *)
PROG
(PARI) for(i=0, 50, print1(", "polcoeff(prod(k=1, 50, (1+x^(3*k+1))), i)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Mar 30 2004
STATUS
approved