Contribution (talk | contribs)
Contribution (talk | contribs)
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 189: Line 189:
<pre>
<pre>
# Enter the values for the X ratio of EDX. Ensure the numerator and denominator differ by 1 or 2.
# Enter the values for the X ratio of EDX. Ensure the numerator and denominator differ by 1 or 2.
numerator, denominator = 7, 6
numerator, denominator = 3, 2


# Program
# Program
Line 236: Line 236:
(pair_1, pair_2) = calculate_complementary_pair(numerator, denominator)
(pair_1, pair_2) = calculate_complementary_pair(numerator, denominator)


print(f"Successive superparticular complementary pair of {numerator}/{denominator} are: {pair_1[0]}/{pair_1[1]} and {pair_2[0]}/{pair_2[1]}")
print(f"Successive superparticular complementary pair of {numerator}/{denominator}: {pair_1[0]}/{pair_1[1]} and {pair_2[0]}/{pair_2[1]}")


# Calculate ratios
# Calculate ratios
Line 249: Line 249:
print_mappings(ratio_log_cents, superparticular_complementary_log_cents, numerator, denominator)
print_mappings(ratio_log_cents, superparticular_complementary_log_cents, numerator, denominator)
</pre>
</pre>
{{todo|Generalize|inline=1|comment=For example, within ed15/8, pair of superparticulars 5/4 and 3/2 are 15/8 complementary. Within ed21/16, pair of superparticulars 9/8 and 7/6 are 21/16 complementary.
Update the code so that it works for any X ratio of EDX without restriction.}}