Indexing all integer partitions of all integers

81 Views Asked by At

Basically, a function that gives each partition of each integer a corresponding number i.e.: $$ \begin{matrix} (\:\:) & (1) & (1,1) & (2) & (1,1,1) & (2,1) & (3) & \ldots\\ \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \\ 0 & 1 & 2 & 3 & 4 & 5 & 6 & \ldots \\ \end{matrix} $$ or maybe: \begin{matrix} (\:\:) & (1) & (2) & (1,1) & (3) & (2,1) & (1,1,1) & \ldots\\ \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \\ 0 & 1 & 2 & 3 & 4 & 5 & 6 & \ldots \\ \end{matrix}

(There's no need for an order like the examples but that would seem like the easiest way to do this)

The way I'm currently doing this is using an algorithm to index all partition of sum $n$ then adding that index to $\sum_{i=0}^{n-1}p(i)$, but I'd like to know if there's a more elegant way of doing this. I feel like it could be related to Young's lattice, but I don't have any clue where I should be looking. Any guidance would be much appreciated.

1

There are 1 best solutions below

3
On BEST ANSWER

Since the overall order does not matter, indexing the set of partitions of positive integers is the same as indexing the set of finite multisets of positive integers, so you could use the following bijection: $$(i_1^{m_1},i_2^{m_2},\ldots,i_k^{m_k})\ \longleftrightarrow\ p_{i_1}^{m_1}\cdot p_{i_2}^{m_2}\cdots p_{i_k}^{m_k} $$ where the LHS is string notation for the multiset composed of "$m_1$ copies of positive integer $i_1 $, $m_2$ copies of positive integer $i_2,\ldots,\ m_k$ copies of positive integer $i_k $", with $i_1<i_2<\ldots<i_k,$ and the RHS is the corresponding prime factorization with $p_i$denoting the $i$th prime. Thus: $$\begin{align}()&\leftrightarrow 1\\ (1)&\leftrightarrow 2^1\\ (2)&\leftrightarrow 3^1\\ (3)&\leftrightarrow 5^1\\ &...\\ (1,1)&\leftrightarrow 2^2\\ (1,2)&\leftrightarrow 2^1\cdot 3^1\\ (2,3)&\leftrightarrow 3^1\cdot 5^1\\ &...\\ (1,1,1,3,6,6)&\leftrightarrow 2^3\cdot 5^1\cdot 13^2\\ &... \end{align}$$