Enumerating all p-tuples of positive integer lower or equal than k that sum up to n.

In this small account we consider the following combinatorial problem:

Enumerate all p-tuples of non-negative integers lower or equal than k that sums up to n.

Example: p = 2, n = 2, k = 2:

(1, 1), (0, 2), (2, 0)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
applied.math.coding

applied.math.coding

526 Followers

I am a mathematician and software developer who likes writing advanced code and to do research in applied and pure mathematics.