Prove that if LCMs are equal, then the numbers are equal too.

I assumed $a$ and $b$ were positive integers.

We have $\mathrm{lcm}(a,a+5) = \frac {a(a+5)}{\gcd(a,a+5)}$, so that the given equality implies $$\frac {a(a+5)}{\gcd(a,a+5)} = \frac {b(b+5)}{\gcd(b,b+5)}.$$ But $\gcd(x,y) = \gcd(x,y+kx)$ for all $k \in \mathbb{Z}$ so that $\gcd(a,a+5) = \gcd(a,5)$ and $\gcd(b,b+5) = \gcd(b,5)$.

Now if $a$ and $b$ are not multiples of $5$ we have $\gcd(a,5) = 1$ and $\gcd(b,5) = 1$ then $$\frac {a(a+5)}{\gcd(a,a+5)} = \frac {b(b+5)}{\gcd(b,b+5)} \implies \frac{a*(a+5)}{1} = \frac{b*(b+5)}{1} \implies a = b.$$

If both $a$ and $b$ are multiple of $5$ then $\gcd(a,5) = \gcd(b,5) = 5$ so that $$\frac {a(a+5)}{\gcd(a,a+5)} = \frac {b(b+5)}{\gcd(b,b+5)} \implies a(a+5) = b(b+5).$$From here we can conclude that $a=b$ by completing the square both sides and using the fact that a,b are positive.

Edit :

If $a$ is a multiple of $5$ and not $b$ we have $$a(a+5)=5b(b+5).$$ But $a=5a′$, then the last equality becomes $$5a′(a′+1)=b(b+5).$$ The left side is a multiple of $5$ but not the right side so this case never happens (same reasoning for the case $b$ multiple of $5$ and not $a$).


As Batominovski pointed out in his comment, $a$ and $b$ have to be positive integers, otherwise there are counterexamples to the statement.

We're going to use the following identities:

i) $ab=[a,b](a,b)$ where $[a,b]$ and $(a,b)$ denotes the $\text{lcm}$ and the $\gcd$ of $a$ and $b$, respectively.

ii) $[ca,cb]=c[a,b]$.

We have $(a,a+5)\mid (a+5)-a=5$, so $(a,a+5)=1$ or $(a,a+5)=5$. Analogously, $(b,b+5)=1$ or $(b,b+5)=5$. So we have four cases to analyze:

I) $(a,a+5)=(b,b+5)=1:$ By the first identity we deduce that $$a(a+5)=[a,a+5]=[b,b+5]=b(b+5).$$ Now, if $a>b$, then $a(a+5)>b(b+5)$ and if $a<b$, then $a(a+5)<b(b+5)$, therefore it must be $a=b$.

II) $(a,a+5)=1$ and $(b,b+5)=5$. Let's write $b=5b'$, then $b+5=5(b'+1)$. On the other hand, by the first identity we have $$a(a+5)=[a,a+5]=[b,b+5]=[5b',5(b'+1)]\overset{\text{by (ii)}}=5[b',b'+1]=5b'(b'+1).$$

Thus, $5\mid a(a+5)$, so $5\mid a$ and then $5\mid a+5$, contradiction; or $5\mid a+5$ and then $5\mid a$, contradiction again.

III) $(a,a+5)=5$ and $(b,b+5)=1$. By the symmetry of $a$ and $b$ this case is analogous to the previous one.

IV) $(a,a+5)=(b,b+5)=5$. Using the first identity we deduce that $$a(a+5)=5[a,a+5]=5[b,b+5]=b(b+5).$$

So, if $a>b$ or $a<b$ we will have $a(a+5)>b(b+5)$ or $a(a+5)<b(b+5)$, respectively. Hence, it must be $a=b$.