6. Let's call the distance between numbers the absolute value of their difference. It is known that the sum of the distances from twelve consecutive natural numbers to a certain number $a$ is 3306, and the sum of the distances from these same twelve numbers to the number $a^{2}$ is 1734. Find all possible values of $a$.
Answer: $a=21, a=-20$.

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

$$
\left\{\begin{array} { l } 
{ | 1 2 a ^ { 2 } - 1 2 k - 6 6 | = 1 7 3 4 , } \\
{ | 1 2 a - 1 2 k - 6 6 | = 3 3 0 6 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
\left|2 a^{2}-2 k-11\right|=289 \\
|2 a-2 k-11|=551
\end{array}\right.\right.
$$

Consider four cases of opening the modulus.

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

$$
\left\{\begin{array} { l } 
{ 2 a ^ { 2 } - 2 k - 1 1 = 2 8 9 , } \\
{ 2 a - 2 k - 1 1 = 5 5 1 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
2 a-2 k-11=551 \\
a^{2}-a+131=0
\end{array}\right.\right.
$$

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

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

$$
\left\{\begin{array} { l } 
{ 2 k + 1 1 - 2 a ^ { 2 } = 2 8 9 , } \\
{ 2 k + 1 1 - 2 a = 5 5 1 }
\end{array} \Leftrightarrow \left\{\begin{array} { l } 
{ 2 k - 2 a = 5 4 0 , } \\
{ a ^ { 2 } - a - 1 3 1 = 0 . }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
k=a+270 \\
a=\frac{1 \pm 5 \sqrt{21}}{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.

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

$$
\left\{\begin{array} { l } 
{ 2 a ^ { 2 } - 2 k - 1 1 = 2 8 9 , } \\
{ 2 k + 1 1 - 2 a = 5 5 1 }
\end{array} \Leftrightarrow \left\{\begin{array} { l } 
{ 2 k - 2 a = 5 4 0 , } \\
{ a ^ { 2 } - a - 4 2 0 = 0 }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
k=a+270 \\
{\left[\begin{array}{l}
a=-20 \\
a=21
\end{array}\right.}
\end{array}\right.\right.\right.
$$

We verify that for both values of $a$ the number $k$ is a natural number ( $a=-20 \Rightarrow k=250$; $a=21 \Rightarrow k=291$ ), so both values of $a$ are suitable.

4) The number $a$ lies to the right, and $a^{2}$ to the left of the segment $[k ; k+11]$. 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=-20$ and $a=21$.