
Number of partitions
npartitions(n, k = NULL, distinct = FALSE, bigz = FALSE)
an non-negative integer to be partitioned
number of parts
an logical to restrict distinct values
an logical to use gmp::bigz
partitions for generating all partitions and ipartitions for iterating partitions
# NOT RUN {
# number of partitions of 10
npartitions(10)
# number of partitions of 10 into 5 parts
npartitions(10, 5)
# integer overflow
# }
# NOT RUN {
npartitions(160)
# }
# NOT RUN {
npartitions(160, bigz = TRUE)
# zero sized partitions
npartitions(0)
npartitions(5, 0)
npartitions(5, 6)
npartitions(0, 0)
npartitions(0, 1)
# }
Run the code above in your browser using DataLab