Contact

PARTITIONS Function (Gnumeric)

Math Intermediate Gnumeric

Count unordered integer partitions in Gnumeric with practical small-input examples and caveats.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Gnumeric. How formula examples are checked

Quick answer

PARTITIONS counts the number of ways to write a nonnegative integer as a sum of positive integers when order does not matter. This is the number-theory partition function, commonly written p(n). It is not the same as COMBIN or PERMUT.

=PARTITIONS(5)

Expected: 7. The seven partitions of 5 are 5, 4+1, 3+2, 3+1+1, 2+2+1, 2+1+1+1, and 1+1+1+1+1. 4+1 and 1+4 are the same partition. Gnumeric source.

Syntax, parameter and release limits

=PARTITIONS(n)
Argument Required? Official meaning Implementation notes
n Yes A nonnegative integer to partition. The 1.12.62 implementation floors a numeric input before computing.

The plugin’s help declares n a nonnegative integer, although the tagged implementation explicitly calls floor on the numeric argument. For example, =PARTITIONS(5.9) is therefore expected to use 5 and return 7; that behaviour is a source-code observation, not a recommended way to supply integer inputs. There is only one argument, so list-separator localization is irrelevant here; localized function names should be confirmed in your Gnumeric UI. Source.

Version: PARTITIONS is explicitly announced as new in Gnumeric 1.12.62 and appears in the official Number Theory plugin with implementation status Unique to Gnumeric and project test status Basic. That project’s existing test status does not mean this research batch executed it. An older or differently built/plugin-configured Gnumeric may not provide the function. Release notes.

Reproduce a small table

  1. In A1 write n and B1 write Number of partitions.
  2. Enter the integers 0 through 10 in A2:A12.
  3. In B2 enter =PARTITIONS(A2) and fill down.
  4. Compare the output with these independently calculated expected values:
n p(n) n p(n)
0 1 6 11
1 1 7 15
2 2 8 22
3 3 9 30
4 5 10 42
5 7 — —

The empty sum is counted once, so p(0)=1. For 4, the five partitions are 4, 3+1, 2+2, 2+1+1, 1+1+1+1. This small dataset can be checked without trusting a single large result.

Advanced application: compare integer partition growth

Make a second column of ratios to see how rapidly the counts grow. With the p(n) values in B2:B12 from above, enter in C3:

=B3/B2

Fill C3 downward. For example, the ratio for n=10 versus n=9 is 42/30 = 1.4, and for n=5 versus n=4 it is 7/5 = 1.4. Ratios are descriptive only; they are not a formula for predicting exact partition counts at larger n.

An independent calculation can use the standard dynamic-programming recurrence: start ways[0]=1; for each allowed part size from 1 through n, add ways[total-part] into ways[total] for totals from that part through n. The procedure counts combinations of parts without treating reorderings as different outcomes; it reproduced the table above in Python, but it did not execute Gnumeric.

Errors, numeric limits and troubleshooting

  • Negative input: The official 1.12.62 implementation returns a #NUM! error after flooring a value below zero. Use nonnegative integer inputs.
  • Excessively large input: The implementation explicitly returns #VALUE! for a floored input greater than 100000. This guard is not a guarantee that values below the threshold are fast, exact or safe.
  • Fractional inputs: They are floored in the tagged implementation, despite the public help specifying integer n; prevalidate/round explicitly if fractional data indicates a mistake.
  • Precision/performance: Large partition counts grow rapidly. The source stores running results in Gnumeric floating-point values and even comments about intermediate overflow; do not present very large outputs as certified exact integer arithmetic without a native precision test.
  • Unknown function: Confirm that your installed build is Gnumeric 1.12.62 or newer and includes/enables the standard Number Theory plugin. The online reference may lag the release source.
  • Wrong combinatorial quantity: PARTITIONS disregards order and does not count arrangements. If order, fixed group sizes or labelled objects matter, the answer is a different combinatorial problem.

PARTITIONS is named as a Gnumeric number-theory feature in the 1.12.62 release. Do not assume that typing the same function in Excel, LibreOffice Calc or Google Sheets produces a result: confirm support in the exact program/version. A helper recurrence or purpose-built script can compute p(n) when there is no equivalent function. The formulas for COMBIN and FACT count different quantities.

Official reference and verification

Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in Gnumeric.

  • No genuine Gnumeric screenshots are included; this guide does not use mock application images.