Work out partition of an integer instantly with clear inputs, formula shown and shareable results.
A partition writes n as an unordered sum of positive integers. The count p(n) is computed by dynamic programming over allowed part sizes, and restricting the largest part or requiring distinct parts gives smaller counts.
Partition recurrence
build p by iterating allowed parts and accumulating p[v] += p[v − part]
42, of which 10 use parts no larger than 4 and 10 use distinct parts.
No simple one. Hardy and Ramanujan gave an asymptotic p(n) ~ exp(π√(2n/3))/(4n√3), later made exact by Rademacher's series.