PowersRepresentations

WMA


PowersRepresentations[n, k, p]

represent n as a sum of k non-negative integers raised to the power of p.

Get the ways licence plate number 1729 can be represented as the sum of two cubes:

See 1729 for the full backstory.

Demonstrate the validity of the Pythagorian triple: 3^2 + 4^2 == 5^2

Since 0 is allowed in the sum, PowersRepresentations[nk+1, p] is includes PowersRepresentations[nkp] with by inserting a zero element at the beginning:

PartitionsP
Prime