3. There is a triangle whose side lengths are natural numbers and whose area is a natural number. One of its sides is the arithmetic mean of the other two, and the sum of the shortest side and the area is equal to the sum of the remaining two sides. Find the lengths of its sides and its area.
3. Let the lengths of the sides of the triangle be $a, b$, and $c$, and its area be $P$. We can assume, without loss of generality, $a \leqslant b \leqslant c$. Then $b$ is the arithmetic mean of $a$ and $c$, so from $b=\frac{a+c}{2}$ we get $c=2 b-a$. Now from $a+P=b+c$ we get $P=b+c-a=b+(2 b-a)-a=3 b-2 a$. We will express the area of the triangle using Heron's formula. We have $s=\frac{a+b+c}{2}=\frac{3 b}{2}, s-a=\frac{3 b}{2}-a, s-b=\frac{b}{2}$, and $s-c=a-\frac{b}{2}$, so it follows that

$$
3 b-2 a=P=\sqrt{\frac{3 b}{2}\left(\frac{3 b}{2}-a\right) \frac{b}{2}\left(a-\frac{b}{2}\right)}=\frac{b}{4} \sqrt{3(3 b-2 a)(2 a-b)}
$$

By squaring both sides, we get $16(3 b-2 a)^{2}=3 b^{2}(3 b-2 a)(2 a-b)$, which simplifies to $16(3 b-2 a)=3 b^{2}(2 a-b)$ (we can cancel out $3 b-2 a$ because from $b \geqslant a$ it follows that $3 b-2 a>0$), i.e., $48 b-32 a=6 a b^{2}-3 b^{3}$. We observe that $3 b^{3}$ is an even number (since all other terms are even), so $b$ must also be an even number, i.e., $b=2 b^{\prime}$. The last equation simplifies to $96 b^{\prime}-32 a=24 a b^{\prime 2}-24 b^{\prime 3}$, i.e., after dividing by $8$, $12 b^{\prime}-4 a=3 a b^{\prime 2}-3 b^{\prime 3}$. From here, we can express

$$
a=\frac{3 b^{\prime 3}+12 b^{\prime}}{3 b^{\prime 2}+4}=\frac{3 b^{\prime 3}+4 b^{\prime}+8 b^{\prime}}{3 b^{\prime 2}+4}=b^{\prime}+\frac{8 b^{\prime}}{3 b^{\prime 2}+4}
$$

Since $a$ is an integer, we get $3 b^{\prime 2}+4 \mid 8 b^{\prime}$, and from there $3 b^{\prime 2}+4 \leqslant 8 b^{\prime}$. Equality is achieved for $b^{\prime}=\frac{8 \pm \sqrt{64-4 \cdot 3 \cdot 4}}{6}=\frac{8 \pm 4}{6}$, i.e., for $b^{\prime}=\frac{2}{3}$ and $b^{\prime}=2$, so the inequality holds for $b^{\prime} \in\left[\frac{2}{3}, 2\right]$. The only natural numbers in this interval are $b^{\prime}=1$ and $b^{\prime}=2$. For $b^{\prime}=1$ we have $a=1+\frac{8}{7}$, which is not a natural number, so no solution is obtained here. For $b^{\prime}=2$ we have $a=2+\frac{16}{3 \cdot 4+4}=2+1=3, b=2 b^{\prime}=4$, $c=2 b-a=2 \cdot 4-3=5$ and $P=3 b-2 a=3 \cdot 4-2 \cdot 3=6$, which is the unique solution to the problem.