Find the number of all triplets (x, y, z) of positive integers such that 1/x + 1/y + 1/z = 1/2021.

306 Views Asked by At

1.Find the number of all triplets $(x, y, z)$ of positive integers such that $$ \frac{1}{x}+\frac{1}{y}+\frac{1}{z}=\frac{1}{2021}.$$

2.How about if $x,y,z$ are odd?

What I did: we can get $$xyz=2021(xy+yz+zx),$$ Since $2021=43\times 47$, then we can let $x=43s,y=47t\Rightarrow z=\dfrac {2021 s t}{s t - 43 s - 47 t}$. But how can I find the $s,t$ such that $z\in\mathbb{N}$?

Here, I only care about the number of solutions instead of caring what the specific solution is.

2

There are 2 best solutions below

0
On

It was necessary to write the solution in a more General form:

$$\frac{t}{q}=\frac{1}{x}+\frac{1}{y}+\frac{1}{z}$$

$t,q$ - integers.

Decomposing on the factors as follows: $p^2-s^2=(p-s)(p+s)=2qL$

The solutions have the form:

$$x=\frac{p(p-s)}{tL-q}$$

$$y=\frac{p(p+s)}{tL-q}$$

$$z=L$$

Decomposing on the factors as follows: $p^2-s^2=(p-s)(p+s)=qL$

The solutions have the form:

$$x=\frac{2p(p-s)}{tL-q}$$

$$y=\frac{2p(p+s)}{tL-q}$$

$$z=L$$

1
On

The following sage code computes the list of all solutions, then counts their number. (One can finally easily extract from the list the solutions with only odd components.)


Let us search first the solutions with $x\ge y\ge z$. The sum of the three positive real numbers $\frac1x$, $\frac1y$, $\frac1z$ is $\frac1{2021}$, so the biggest one is $\frac1z\ge \frac1{3\cdot 2021}$, so $z\le 3\cdot 2021$. For each possible integer $z$ with $2021< z\le 3\cdot 2021$ we compute the fraction $$ \frac 1{2021}-\frac 1{z}=f=\frac ab\qquad \text{ with }a, b\in\Bbb Z_{>0}\ ,\ (a,b)=1\ . $$ Here, $a, b$ are relatively prime (natural) numbers. Then we try to write $f=\frac ab$ in the form $\frac 1x+\frac 1y=\frac {x+y}{xy}=\frac ab$. This gives $axy=b(x+y)$, so $$ (ax-b)(ay-b)=a^2xy -abx -aby + b^2 = b^2\ . $$ The integers $(ax-b)$ and $(ay-b)$ are (complementary) divisors of $b^2$. They cannot be both negative, since then $b^2=(ax-b)(ay-b)\le|ax-b|\; |ay-b|\le b\cdot b=b^2$, and for the equality we must have $x=y=0$. So they are nonzero natural numbers. To collect the relevant possibilities we let $d_x>0$ run over the divisors of $b^2$, consider $d_y=b^2/d_x$, and have to arrange that $(*)$ both $x=(b+d_x)/a$ and $y=(b+d_y)/a$ are in $\Bbb Z$. Recall that we started with $x\ge y$, so correspondingly $d_x\ge d_y$, i.e. $d_x^2\ge d_xd_y=b^2$, i.e. $d_x\ge b\ge d_y$. (The "coincidences" of values for $a,b$ with the condition $(*)$ above satisfied are no longer considered in a "theoretical" manner, we just let the engine decide in the finitely many cases what happens...)

The following code is self-explanatory. (sage syntax is close to human language.)

solutions = []
N = 2021
for z in [N + 1 .. 3*N]:
    f = 1/N - 1/z
    new_solutions = []
    a, b = f.numerator(), f.denominator()
    dy_candidates = [dy for dy in (b^2).divisors() 
                     if dy <= b and (b + dy) % a == 0]
    for dy in dy_candidates:
        x, y = (b + b^2/dy)/a, (b + dy)/a
        new_solutions += list(set([(x, y, z), (y, z, x), (z, x, y),
                                   (x, z, y), (z, y, x), (y, x, z),]))
    if new_solutions:
        print(f'z = {z} :: # new solutions = {len(new_solutions)}')
        solutions += new_solutions

solutions = list(set(solutions))
solutions.sort()

different_solutions     = [(x, y, z) for (x, y, z) in solutions if x <= y and y <= z]
odd_solutions           = [(x, y, z) for (x, y, z) in solutions if x*y*z % 2]
different_odd_solutions = [sol for sol in odd_solutions if sol in different_solutions]

print(f'FOUND :: #               solutions = {len(          solutions)}')
print(f'FOUND :: # different     solutions = {len(different_solutions)}')
print(f'FOUND :: #           odd solutions = {len(odd_solutions)}')
print(f'FOUND :: # different odd solutions = {len(different_odd_solutions)}')

Well, it took some seconds to print the progress (and compute) the few solutions, here is the count of them... this was the question...

FOUND :: #               solutions = 13978
FOUND :: # different     solutions = 2339
FOUND :: #           odd solutions = 2245
FOUND :: # different odd solutions = 379

(In the "different solutions" we collect only triples $x,y,z$ with $x\le y\le z$.)


Example: Some random odd solution is...

sage: import random
sage: random.choice(different_odd_solutions)
(3225, 8385, 15275)

This was found as follows. In the $z$-loop, $z$ took the special value $3225$. (The other values are too big...) Then we compute the fraction $$ f=\frac 1{2021}-\frac 1{3225}=\frac {28}{151575}\ , $$ and we use $a=28$, $b=151575=3 \cdot 5^{2} \cdot 43 \cdot 47$. There are $(2\cdot 1+1)(2\cdot 2+1)(2\cdot 1+1)(2\cdot 1+1) = 3^3\cdot 5=135$ divisors of $b^2$. Among them we consider only those $d_y\le b$ so that $d_y\equiv -b\pmod a$. Here they are:

sage: f = 1/N - 1/3225
sage: f
28/151575
sage: a, b = f.numerator(), f.denominator()
sage: a, b
(28, 151575)
sage: len((b^2).divisors())
135
sage: [dy for dy in (b^2).divisors() if dy <= b and (dy + b) % a == 0]
[45, 129, 18189, 83205]

For each such $d_y$ we compute the corresponding $d_x=b^2/d_y$, and compute $x=(b+d_x)/a$, $y=(b+d_y)/a$. The $y$-values found are...

sage: [(b + dy)/a for dy in (b^2).divisors() if dy <= b and (dy + b) % a == 0]
[5415, 5418, 6063, 8385]

And indeed, the $8385$ from the random solution we started with is in the list.


After sorting, the last few "different odd" solutions are:

sage: different_odd_solutions[-30:]
[(3423, 4935, 34589415),
 (3431, 9417, 10293),
 (3465, 4851, 16339785),
 (3483, 4815, 87580035),
 (3525, 4737, 79778975),
 (3573, 4653, 79431363),
 (3575, 4653, 5911425),
 (3591, 5719, 24111),
 (3619, 4577, 712259009),
 (3713, 4435, 708087665),
 (3835, 4277, 4173365),
 (3905, 4189, 465628295),
 (3913, 4277, 183911),
 (3927, 4165, 16339785),
 (3995, 4097, 2435305),
 (3995, 5405, 16813),
 (3999, 4089, 5450637),
 (3999, 4371, 62651),
 (4043, 4043, 8170903),
 (4085, 4085, 191995),
 (4085, 4465, 38399),
 (4089, 4089, 175827),
 (4257, 4653, 22231),
 (4277, 5719, 11609),
 (4389, 5719, 10857),
 (4515, 4935, 14147),
 (5719, 6251, 6251),
 (5805, 6063, 6345),
 (5891, 5891, 6439),
 (6063, 6063, 6063)]