1001Ferramentas
🧩 Generators

Integer Partitions p(n)

Compute p(n), the number of ways to write an integer as a sum of positive integers regardless of order, and list the partitions for small values. A central function in the theory of partitions studied by Euler and Ramanujan.

Resultado

Partições de um inteiro

Uma partição de n é uma forma de escrevê-lo como soma de inteiros positivos, sem importar a ordem. Por exemplo, 4 tem 5 partições: 4, 3+1, 2+2, 2+1+1, 1+1+1+1, então p(4) = 5. A função p(n) cresce rapidamente — p(10) = 42, p(100) já passa de 190 milhões. Euler estudou sua função geradora e Ramanujan descobriu congruências surpreendentes, como p(5k+4) ≡ 0 (mod 5).

Related Tools