Yαεn's Algorithm

The Problem

You are given 100 pennies which are equivalent to a dollar. You must arrange these pennies in the following stacks (3, 5, 6, 7, and 9). An example is provided in the first picture.

Each one of these groups has to have the same amount of pennies in each stack. For example, if I wanted to put 3 cents in one of the stacks for the group of 3 then I would be putting 3 cents on each stack which would equal 9 cents in the whole group. This is shown in the second image.

The following algorithm will look for all possible combinations following the previously stated rules. Down below insert five values that would represent the amount of stacks per group. This number has to be in between 1 to 9 (0 < x > 10). For example (1, 2, 3, 4, 5)

hello world

Valid Combinations:

Invalid Combinations:

Possible Combinations: