6. a) Find at least two different natural numbers $n$, for each of which the number $n^{2}+2015 n$ is a perfect square of a natural number.

b) Find the number of all natural numbers $n$, for each of which the number $n^{2}+$ $2015 n$ is a perfect square of a natural number.
Answer. a) For example $n=496$ and $n=1007^{2}=1014049$. b) 13.

## Solution. FIRST METHOD.

Let $n^{2}+2015 n=m^{2}$. Denote $d=$ GCD $(n, 2015), n=d \nu, 2015=d r$. Then $\nu$ and $r$ are coprime, and

$$
d^{2} \nu(\nu+r)=m^{2}
$$

Since $\nu$ and $\nu+r$ are coprime, each of them must be a square of a natural number, i.e., $\nu=a^{2}, \nu+r=b^{2}$. Then $r=(b-a)(b+a)$.

a) To obtain some values of $n$, we can choose $d, a, b$ according to the above scheme. The number $d$ is a divisor of the number $2015=5 \cdot 13 \cdot 31$. For example, let's choose $d=1$. Then $r=2015=(b-a)(b+a)$. Let $b-a=1, b+a=2015$. Then $b=1008, a=1007$, and we get the first value $n=a^{2} d=1007^{2}$.

Now let's take $d=31$. Then $r=65=(b-a)(b+a)$. Let $b-a=5, b+a=13$. Then $b=9, a=4, n=a^{2} d=496$.

b) From the above reasoning, it follows that this scheme gives all solutions. Moreover, since $d$ is not divisible by the square of a prime number, different $d, a$ will correspond to different $n$. Let's count how many different $n$ can be obtained. The number $d$ is a divisor of the number $2015=5 \cdot 13 \cdot 31$. Consider 4 cases:

- $d=1$. Then $r=2015=(b-a)(b+a)$. The number 2015 has 8 different divisors, and thus can be represented in 4 ways as $2015=(b-a)(b+a)$. (Considering that $b-a<b+a$). For each such representation, both numbers $b-a, b+a$ are odd, and thus $a, b$ are uniquely determined. Knowing $a, b, d$, we can uniquely find $n=d \cdot a^{2}$. Thus, in this case, we have 4 different numbers $n$.
- $d=5,13$ or 31. Then $r$ is the product of two prime numbers and can be represented in the form $r=(b-a)(b+a)$ in two ways. Thus, we have $3 \cdot 2=6$ answers.
- $d=65,155$ or 403. Then $r$ is a prime number, and can be represented in the form $r=(b-a)(b+a)$ in a unique way. Thus, we have 3 more answers.
- $d=2015$. Then $r=1$, and the equation $r=(b-a)(b+a)$ is impossible, since $a, b$ are natural numbers.

In total, $4+6+3=13$ different numbers $n$.

## SECOND METHOD.

Let $n^{2}+2015 n=m^{2}$. Multiplying by 4 and completing the square on the left side, we transform the equation to

$$
(2 n+2015)^{2}=4 m^{2}+2015^{2} \Rightarrow(2 n-4 m+2015)(2 n+4 m+2015)=2015^{2}
$$

Denoting $2 n-4 m+2015=a, 2 n+4 m+2015=b$, we get that all sought values of $n$ are determined by the conditions

$$
a<b, a b=2015^{2}, \quad n=\frac{a+b-2 \cdot 2015}{4}
$$

a) To obtain some specific values of $n$, we can take specific factorizations $a b=2015^{2}=5^{2} \cdot 13^{2} \cdot 31^{2}$. For example, if $a=1, b=2015^{2}$, then $n=4060226$. If $a=25 \cdot 31, b=169 \cdot 31$, then $n=496$.

b) Note that for any factorization $2015^{2}=a b$, the number $n$, determined by the equation $n=\frac{a+b-2 \cdot 2015}{4}$, is an integer. This follows from the fact that $a b=2015^{2} \equiv 1(\bmod 4)$, so either $a \equiv b \equiv 1(\bmod 4)$ or $a \equiv b \equiv 3(\bmod 4)$. In both cases, $a+b \equiv 2 \equiv 2 \cdot 2015(\bmod 4)$. Thus, the number of sought numbers $n$ is equal to the number of factorizations $a b=2015^{2}, a<b$. The number $2015^{2}$ has exactly 27 different divisors. One of them is 2015, and the rest form pairs $(a, b), a<b, a b=2015^{2}$. Therefore, the number of such pairs is $\frac{27-1}{2}=13$.

Criteria.

## $(-)$

(-.) One value in part a)

$(-/+)$ Correctly solved part a)

$(+/ 2)$ or (+/-) Part a) and progress in part b) (depending on progress)

$$
(+/-)
$$

$$
\text { (+.) }
$$

$(+)$ clean solution