Ganaram inukshuk (talk | contribs)
Ganaram inukshuk (talk | contribs)
Line 14: Line 14:
Begin with a nested table of ratios, with the nested table containing the ratio 1/1. Use this table to keep track of all found ratios, where 1/1 is the initial ratio.
Begin with a nested table of ratios, with the nested table containing the ratio 1/1. Use this table to keep track of all found ratios, where 1/1 is the initial ratio.


Given a subgroup (as a table of whole numbers and/or ratios), equave, and an int limit, repeat the following until the following until no new ratios can be found.
Given a subgroup (as a table of whole numbers and/or ratios), equave, and an int limit, repeat the following until no new ratios can be found.
* Create an empty table to keep track of products of ratios.
* Create an empty table to keep track of products of ratios.  
* For each ratio in the last table in the nested table and for each member in the subgroup, find the product of that ratio and that subgroup member and insert it to the table of products. Simplify any new ratios and do not add duplicates.
* For each ratio in the last table in the nested table and for each member in the subgroup, find the product of that ratio and that subgroup member and insert it to the table of products. Simplify any new ratios and do not add duplicates.
* Create a second empty table to keep track of new ratios.
* For each product found, perform the following until no new ratios can be found: search for all ratios between 1/1 and the equave by using breadth-first search, by dividing the product by each subgroup member. Insert search results into the table of new ratios. Simplify any new ratios and do not add duplicates.
* Add the table of new ratios to the nested table.


== Main mindset ==
== Main mindset ==