How to calculate the sum of the multiples of two fractions in order?

77 Views Asked by At

$\frac{a}{b_1}, \frac{a}{b_2} = \frac{1}{3}, \frac{1}{5}$

$x_1 \in \{0, ..., b_1-1\} = \{0, 1, 2\}$

$x_2 \in \{0, ..., b_2-1\} = \{0, 1, 2, 3, 4\}$

$$\frac{a_1}{b}, \frac{a_2}{b} = \frac{a_1b_2}{b_1b_2}, \frac{a_2b_1}{b_1b_2} = \frac{5}{15}, \frac{3}{15}$$

$$\frac{p}{q} = \frac{a_1x_1}{b} + \frac{a_2x_2}{b}$$

I've been struggling for a couple of days to find an equation that can calculate $\frac{p}{q}$ in order from smallest to largest. Any help will be appreciated thank you.

The sums in order:

$$\frac{5\cdot0 + 3\cdot0}{15} = \frac{0}{15}, \frac{5\cdot0 + 3\cdot1}{15} = \frac{3}{15}, \frac{5\cdot1 + 3\cdot0}{15} = \frac{5}{15}, \frac{5\cdot0 + 3\cdot2}{15} = \frac{6}{15}$$

$$\frac{5\cdot1 + 3\cdot1}{15} = \frac{8}{15}, \frac{5\cdot0 + 3\cdot3}{15} = \frac{9}{15}, \frac{5\cdot2 + 3\cdot0}{15} = \frac{10}{15}, \frac{5\cdot1 + 3\cdot2}{15} = \frac{11}{15}$$

$$\frac{5\cdot0 + 3\cdot4}{15} = \frac{12}{15}, \frac{5\cdot2 + 3\cdot1}{15} = \frac{13}{15}, \frac{5\cdot1 + 3\cdot3}{15} = \frac{14}{15}, \frac{5\cdot2 + 3\cdot2}{15} = \frac{16}{15}$$

$$\frac{5\cdot1 + 3\cdot4}{15} = \frac{17}{15}, \frac{5\cdot2 + 3\cdot3}{15} = \frac{19}{15}, \frac{5\cdot2 + 3\cdot4}{15} = \frac{22}{15}$$

1

There are 1 best solutions below

0
On

Hint: This isn't an answer it is just a way you can think about it, and I am not sure that it will take you somewhere or not, but name the set $A=\{0, ..., b_1-1\}$ and $B= \{0, ..., b_2-1\}$

And try taking the sequence $$x_{n,k}=\frac{b_1.n+b_2.k}{lcm(b_1,b_2)}$$ Where $n \in A$ and $k \in B$

Then after that take the $\displaystyle \min_{n \in A,k\in B}(x_{n,k})=x_{n_0,k_0}$ and you'll get the first elemnt you want call it $c_1$ (which is $\frac{0}{15}$ in your case)

Then exclude this element from the sequence (by excluding $n_0$ from $A$ and $k_0$ from $B$) and take the minimum again and so on...