# Generating Function for Partitions

When I was at the ARML Power Contest, I came upon question 11 which stated: Explain why the number of partitions of $$n$$ into all different parts is given by the coefficient of $$x^{n}$$ in the expansion of the product $$\left(1+x\right)\left(1+x^{2}\right)\left(1+x^{3}\right)...\left(1+x^{n}\right)$$.

The answer explains how, when the product is expanded but like terms are not collected, each different term that is $$x^{n}$$ is formed from adding the powers of several terms from the initial semi-factored form.

I was wondering, does anybody know if there's a generating function or regular old function for the total number of partitions a number can be split into? I tried finding one in terms of sigma, then started working on a Python solution, but it doesn't seem like there is. The formulas I used had to do with combinations and even the same kind of logic that is used to determine the number of ways a certain number can be rolled using any number of dice. If an experienced computer scientist can come up with a great Python or Java version, that would be great also.

Thanks,

Tristan Shin

Note by Tristan Shin
4 years, 6 months ago

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$...$$ or $...$ to ensure proper formatting.
2 \times 3 $$2 \times 3$$
2^{34} $$2^{34}$$
a_{i-1} $$a_{i-1}$$
\frac{2}{3} $$\frac{2}{3}$$
\sqrt{2} $$\sqrt{2}$$
\sum_{i=1}^3 $$\sum_{i=1}^3$$
\sin \theta $$\sin \theta$$
\boxed{123} $$\boxed{123}$$

Sort by:

For regular partitions, the generating function is $\frac{1}{(1 - x)(1 - x^2)(1 - x^3) \dotsm}.$ See http://en.wikipedia.org/wiki/Partition%28numbertheory%29

- 4 years, 6 months ago

Thanks! It seems that just a little bit of manipulation can cause wonderful generating functions!

- 4 years, 6 months ago
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9700227379798889, "perplexity": 1628.986187331942}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-30/segments/1531676593208.44/warc/CC-MAIN-20180722100513-20180722120513-00057.warc.gz"}