P() returns the number of additive
partitions, Q() returns the number of unequal
partitions, and R() returns the number of
restricted partitions. Function S() returns the number of
block partitions.P(n, give = FALSE)
Q(n, give = FALSE)
R(m, n, include.zero = FALSE)
S(f, n = NULL, include.fewer = FALSE)S(), the default of NULL means to return the number of
partitions of any sizeR(), the order of the
decompositionFALSE meaning to return just
P(n) or Q(n) and TRUE meaning to return
P(1:n) or Q(1:n) (this option takes no extra
computation)restrictedparts(), Boolean with
default FALSE meaning to count only partitions of $n$
into exactly $m$ parts; and TRUE meaning to
include partitions of $n$ into at most $m$ parts
blockparts(), Boolean
with default FALSE meaning to return partitions into
exactly n and TRUE meaning to return partitions
into at most nS(), the stack vectorP() and Q() use Euler's
recursion formula. Function R() enumerates the partitions
using Hindenburg's method (see Andrews) and counts them until the
recursion bottoms out. Function S() finds the coefficient of~$x^n$ in the
generating function $\prod_{i=1}^L\sum_{j=0}^{f_i}
x^j$, where $L$ is the
length of f, using the
P(10,give=TRUE)
Q(10,give=TRUE)
R(10,20,include.zero=FALSE)
R(10,20,include.zero=TRUE)
S(1:4,5)Run the code above in your browser using DataLab