Monday, October 31, 2016

Gazeta Matematica 4/2016, Problem S:L16.140

Problem:
Determine all prime numbers $p,q$ such that $$p^2+pq+q^2$$ is a perfect square.

Proposed by Alessandro Ventullo, Milan, Italy


Solution:
Observe that $p^2<p^2+pq+q^2<(p+q)^2$ for all primes $p,q$. Hence, $$p^2+pq+q^2=(p+k)^2,$$ where $k \in \{1,2,\ldots,q-1\}$, i.e. $$pq+q^2=2kp+k^2.$$ We get
$$
p(2k-q)=(q-k)(q+k) \qquad (1)
$$
Since the right-hand side is positive, it follows that $q<2k$. Moreover, since $p$ is prime, then $p \ | \ (q-k)$ or $p \ | \ (q+k)$.

(i) If $p \ | \ (q-k)$, then $q-k=ph$ for some $h \in \mathbb{N}$, so equation (1) becomes $$2k-q=h(k+q).$$ It follows that $(k+q) \ | \ (2k-q)$. Since $2k-q=2(k+q)-3q$, then $(k+q) \ | \ 3q$. If $q=3$, there is no solution. If $q \neq 3$, we have $k+q \in \{1,3,q,3q\}$. But $1<q<k+q<2q<3q$, so it must be $k+q=3$. Since $q$ is prime, this gives $q=2$ and $k=1$, but this would imply that $p \ | \ 1$, contradiction.

(ii) If $p \ | \ (q+k)$, then $q+k=ph$ for some $h \in \mathbb{N}$, so equation (1) becomes $$2k-q=h(q-k).$$ It follows that $(q-k) \ | \ (2k-q)$. Since $2k-q=2(k-q)+q$, then $(q-k) \ | \ q$. But $q-k<q$, so $q-k=1$. Equation (1) becomes $$p(q-2)=2q-1,$$ which implies $(q-2) \ | \ (2q-1)=[2(q-2)+3]$, i.e. $(q-2) \ | \ 3$. So, $q=3$ or $q=5$, which gives $p=5$ or $p=3$ respectively.

Therefore, $(p,q) \in \{(3,5),(5,3)\}$.

Note:
A variant of this problem can be the following:

Let $p,q$ be prime numbers such that $$p^2+pq+q^2$$ is a perfect square. Prove that $$p^2-pq+q^2$$ is prime.
\newline\newline
Indeed, $p$ and $q$ can be found as before and we get $p^2-pq+q^2=19$.

Monday, October 3, 2016

Gazeta Matematica 2/2016, Problem E:14971

Problem:
Solve in integers the equation
$$(x+1)^2+(y+1)^2+xy(x+y+3)=2.$$

Proposed by Alessandro Ventullo, Milan, Italy
Solution:
Observe that $$\begin{array}{lll}(x+1)^2+(y+1)^2+xy(x+y+3)-1&=&x^2+y^2+2xy+2x+2y+1+xy(x+y+1)\\&=&(x+y+1)^2+xy(x+y+1)\\&=&(x+y+1)(x+1)(y+1), \end{array}$$ so the equation can be rewritten as $$(x+y+1)(x+1)(y+1)=1.$$ Therefore, at least one of the three factors is equal to $1$. We have the three systems of equations
$$\begin{array}{rll} x+y+1&=&1 \\ (x+1)(y+1)&=&1, \end{array} \qquad \begin{array}{rll} x+1&=&1 \\ (x+y+1)(y+1)&=&1, \end{array} \qquad \begin{array}{rll} y+1&=&1 \\ (x+y+1)(x+1)&=&1. \end{array}$$
Solving each system we get that $(x,y) \in \{(0,0),(-2,0),(0,-2)\}$.

Gazeta Matematica 2/2016, Problem E:14970

Problem:
Let $$\begin{array}{rcl}a_1&=&25 \\ a_n&=&\underbrace{22\ldots 2}_{n \textrm{ times}}\underbrace{44\ldots 4}_{n-1 \textrm{ times}}5, \qquad n \geq 2. \end{array}$$
Prove that $a_n$ can be written as the sum of two perfect squares for any integer $n \geq 1$.

Proposed by Alessandro Ventullo, Milan, Italy


Solution:
Clearly, $a_1=9+16=3^2+4^2$. Moreover, we have $$\begin{array}{rcl} a_n&=&\underbrace{22\ldots 2}_{n \textrm{ times}}\underbrace{44\ldots 4}_{n-1 \textrm{ times}}5 \\ &=& \underbrace{22\ldots 2}_{n \textrm{ times}}\cdot 10^n + \underbrace{44\ldots 4}_{n-1 \textrm{ times}}\cdot10+5 \\ &=& \dfrac{2\cdot(10^n-1)}{9}\cdot10^n+\dfrac{4(10^{n-1}-1)}{9}\cdot10+5 \\ &=& \dfrac{2\cdot10^{2n}-2\cdot10^n+4\cdot10^n+5}{9} \\ &=&\dfrac{10^{2n}-2\cdot10^n+1}{9}+\dfrac{10^{2n}+4\cdot10^n+4}{9} \\ &=& \left(\dfrac{10^n-1}{3}\right)^2+\left( \dfrac{10^n+2}{3} \right)^2  \end{array}.$$ Observe that $\dfrac{10^n-1}{3}$ and $\dfrac{10^n+2}{3}$ are integers since $10^n-1$ and $10^n+2$ are divisible by $3$ for any $n \geq 1$.