Problem 7. (15 points) Let $\mathbf{S}_{\mathbf{n}}$ be the sum of the first p terms of the arithmetic progression $\left\{\mathbf{a}_{\mathbf{n}}\right\}$. It is known that $\mathbf{S}_{\mathbf{n}+1}=2 \mathbf{n}^{2}-21 \mathbf{n}-23$.

a) State the formula for the p-th term of this progression.

b) Find the smallest in absolute value sum $\mathbf{S}_{\mathbf{n}}$.

c) Find the smallest $\mathrm{n}$ for which $\mathbf{S}_{\mathbf{n}}$ is a square of an integer.
# Solution:

a) $a_{n}=4 n-27 . S_{n}=S_{(n-1)+1}=2(n-1)^{2}-21(n-1)-23=2 n^{2}-25 n$;

$S_{n-1}=2(n-1)^{2}-25(n-1)=2 n^{2}-29 n+27 \Rightarrow a_{n}=S_{n}-S_{n-1}=4 n-27$.

b) -12. Since $a_{n}=4 n-270$ for $n \geq 7, S_{n}$ decreases from the value $a_{1}=-23$ to $S_{6}$, then increases.

$S_{n}=2 n^{2}-25 n0$ for $n \geq 13$. Therefore,

$\left|S_{n}\right|_{\text {min }}=\min \left\{\left|a_{1}\right| ;\left|S_{12}\right| ;\left|S_{13}\right|\right\}=\min \{|-23| ;|-12| ; 13\}=12$ at $n=12 . S_{12}=-12$.

c) 25. Let $S_{n}=2 n^{2}-25 n=k^{2}$.

Note that the number $n(2 n-25)$ will definitely be the square of an integer if $n=2 n-25$, that is, when $n=25$. We will show that $S_{n}$ is not a perfect square for $n \in[13 ; 24]$.

1st method. Determine what the last digit of the number $2 n^{2}-25 n$ can be, depending on the last digit of the number $n$, and record the results in a table.

| $n$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| $2 n^{2}-25 n$ | 0 | 7 | 8 | 3 | 2 | 5 | 2 | 3 | 8 | 7 |

Of all the options in the second row of the table, a square of an integer can only end in 0 and 5, when $n$ also ends in 0 and 5. There are two such numbers in the considered range: 15 and 20. The numbers $S_{15}=75$ and $S_{20}=300$ are not perfect squares. Therefore, for $n \in[13 ; 24]$, the equality (*) is impossible, as required.

2nd method. Determine what values the remainders of the left and right parts of the equality ( ${ }^{*}$ ) can take when divided by 5. Construct a table of remainders, using the known statement of residue arithmetic: the product (sum) of numbers gives the same remainder when divided (by some number) as the product (sum) of the remainders of these numbers.

| $n$ | 0 | 1 | 2 | 3 | 4 |
| :--- | :--- | :--- | :--- | :--- | :--- |
| $n^{2}$ | 0 | 1 | 4 | 4 | 1 |
| $2 n^{2}-25 n$ | 0 | 2 | 3 | 3 | 2 |

In constructing the table, it is taken into account that $25 n$ is divisible by 5, that is, it gives a remainder of 0. The numbers 2 and 3 cannot be remainders when dividing a square of an integer by 5 (see the second row of the table). Therefore, $n$ is divisible by 5. The rest is as in the 1st method.

Answer: a) $\mathrm{a}_{\mathrm{n}}=4 \mathrm{n}-27$; b) -12 ; c) 25