partitions-package {partitions}R Documentation

Integer partitions

Description

Routines to enumerate all partitions of an integer; includes restricted and unequal partitions.

Details

This tiny package comprises six functions: P(), Q(), and R() give the number of partitions, unequal partitions, and restricted partitions of an integer.

Functions parts(), diffparts(), and restrictedparts() enumerate these partitions.

Function conjugate() gives the conjugate of a partition and function durfee() gives the size of the Durfee square.

NB the emphasis in this package is terse, efficient C code. This means that there is a minimum of argument checking. For example, function conjugate() assumes that the partition is in standard form (ie nonincreasing); supplying a vector in nonstandard form will result in garbage being returned silently.

Author(s)

Robin K. S. Hankin

References

G. E. Andrews 1998 “The Theory of Partitions”, Cambridge University Press

M. Abramowitz and I. A. Stegun 1965. “Handbook of Mathematical Functions”, New York: Dover

G. H. Hardy and E. M. Wright 1985 “An introduction to the theory of numbers”, Clarendon Press: Oxford (fifth edition)

R. K. S. Hankin 2006. “Additive Integer Partitions in R”. Journal of Statistical Software, volume 16, codesnippet 1.

Examples

 parts(5)
 diffparts(9)
 restrictedparts(15,10)
 P(10,give=TRUE)
 Q(10,give=TRUE)
 R(5,10)

[Package partitions version 1.1-2 Index]