6. Let's call the distance between numbers the absolute value of their difference. It is known that the sum of the distances from thirteen consecutive natural numbers to some number $a$ is 260, and the sum of the distances from these same thirteen numbers to the number $a^2$ is 1768. Find all possible values of $a$.
Answer: $a=-12, a=13$.

Solution. Let the given consecutive natural numbers be denoted by $k, k+1, \ldots, k+12$. Notice that if some number lies on the segment $[k ; k+12]$, then the sum of distances from it to the given thirteen numbers does not exceed $\frac{13}{2} \cdot 12=78$ (the sum of distances to the two extreme numbers is exactly 12, the sum of distances to $k+1$ and $k+11$ does not exceed 12, the sum of distances to $k+2$ and $k+10$ also does not exceed 12, and so on; the distance to $k+6$ does not exceed half the length of the segment between the numbers, i.e., 6). Therefore, the numbers $a$ and $a^{2}$ lie outside the segment $[k ; k+12]$. Then the sum of distances from the number $a$ to each of the given consecutive numbers is expressed by the formula $|20 a-k-(k+1)-\ldots-(k+19)|=|20 a-20 k-190|$. Similarly, the sum of distances from the number $a^{2}$ to each of the given numbers is $\left|20 a^{2}-20 k-190\right|$. We obtain the system of equations

$$
\left\{\begin{array} { l } 
{ | 1 3 a ^ { 2 } - 1 3 k - 7 8 | = 1 7 6 8 , } \\
{ | 1 3 a - 1 3 k - 7 8 | = 2 6 0 . }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
\left|a^{2}-k-6\right|=136 \\
|a-k-6|=20
\end{array}\right.\right.
$$

Consider four cases for the removal of the modulus.

1) Both numbers $a$ and $a^{2}$ lie to the right of the segment $[k ; k+12]$. Then

$$
\left\{\begin{array} { l } 
{ a ^ { 2 } - k - 6 = 1 3 6 , } \\
{ a - k - 6 = 2 0 }
\end{array} \Leftrightarrow \left\{\begin{array} { l } 
{ a - k - 6 = 2 0 , } \\
{ a ^ { 2 } - a - 1 1 6 = 0 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
k=a-26 \\
a=\frac{1 \pm \sqrt{465}}{2}
\end{array}\right.\right.\right.
$$

Then from the first equation of the system, it follows that $k$ is an irrational number, which does not satisfy the condition of the problem.

2) Both numbers $a$ and $a^{2}$ lie to the left of the segment $[k ; k+12]$. Then

$$
\left\{\begin{array} { l } 
{ k + 6 - a ^ { 2 } = 1 3 6 , } \\
{ k + 6 - a = 2 0 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
k+6-a=20 \\
a^{2}-a+116=0
\end{array}\right.\right.
$$

The discriminant of the quadratic equation is negative, so there are no solutions.

3) The number $a$ lies to the left, and $a^{2}$ - to the right of the segment $[k ; k+12]$. Then

$$
\left\{\begin{array} { l } 
{ a ^ { 2 } - k - 6 = 1 3 6 , } \\
{ k + 6 - a = 2 0 }
\end{array} \Leftrightarrow \left\{\begin{array} { l } 
{ k + 6 - a = 2 0 , } \\
{ a ^ { 2 } - a - 1 5 6 = 0 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
k=a+14 \\
{\left[\begin{array}{l}
a=-12 \\
a=13
\end{array}\right.}
\end{array}\right.\right.\right.
$$

We verify that for both values of $a$, the number $k$ is a natural number ($a=-12 \Rightarrow k=2$; $a=13 \Rightarrow k=27$), so both values of $a$ are valid.

4) The number $a$ lies to the right, and $a^{2}$ - to the left of the segment $[k ; k+12]$. Obviously, this case does not fit, because if $a>a^{2}$, then both numbers $a$ and $a^{2}$ lie on the segment $[0 ; 1]$, but then there cannot be any integer between them.

Thus, there are two possible cases: $a=-12$ and $a=13$.