12. (18th Korean Mathematical Olympiad) Find all positive integers $n$ that can be uniquely expressed as the sum of the squares of 5 or fewer positive integers (here, two expressions with different orders of summation are considered the same, such as $3^{2}+4^{2}$ and $4^{2}+3^{2}$ being considered the same expression for 25).
12. $n=1,2,3,6,7,15$.

First, prove that for all $n \geqslant 17$, there are more than 2 different expressions.
Since every positive integer can be expressed as the sum of 4 or fewer positive integer squares (Lagrange's four-square theorem), there exist non-negative integers $x_{i}, y_{i}, z_{i}, w_{i} (i=1,2,3,4)$ satisfying
桖
林
克
娄
数
学
的
数
论
问
题
$$
\begin{array}{l}
n-0^{2}=x_{0}^{2}+y_{0}^{2}+z_{0}^{2}+w_{0}^{2}, \\
n-1^{2}=x_{1}^{2}+y_{1}^{2}+z_{1}^{2}+w_{1}^{2}, \\
n-2^{2}=x_{2}^{2}+y_{2}^{2}+z_{2}^{2}+w_{2}^{2}, \\
n-3^{2}=x_{3}^{2}+y_{3}^{2}+z_{3}^{2}+w_{3}^{2}, \\
n-4^{2}=x_{4}^{2}+y_{4}^{2}+z_{4}^{2}+w_{4}^{2} .
\end{array}
$$

Thus, we have
$$
\begin{aligned}
n & =x_{0}^{2}+y_{0}^{2}+z_{0}^{2}+w_{0}^{2}=1^{2}+x_{1}^{2}+y_{1}^{2}+z_{1}^{2}+w_{1}^{2}=2^{2}+x_{2}^{2}+y_{2}^{2}+z_{2}^{2}+w_{2}^{2} \\
& =3^{2}+x_{3}^{2}+y_{3}^{2}+z_{3}^{2}+w_{3}^{2}=4^{2}+x_{4}^{2}+y_{4}^{2}+z_{4}^{2}+w_{4}^{2} .
\end{aligned}
$$

Assume $n \neq 1^{2}+2^{2}+3^{2}+4^{2}=30$, then
$$
\{1,2,3,4\} \neq\left\{x_{0}, y_{0}, z_{0}, w_{0}\right\} \text {. }
$$

Therefore, there exists $k \in\{1,2,3,4\} \backslash\left\{x_{0}, y_{0}, z_{0}, w_{0}\right\}$, and for such $k$, $x_{0}^{2}+y_{0}^{2}+z_{0}^{2}+w_{0}^{2}$ and $k^{2}+x_{k}^{2}+y_{k}^{2}+z_{k}^{2}+w_{k}^{2}$ are different expressions of $n$.
Since $30=1^{2}+2^{2}+3^{2}+4^{2}=1^{2}+2^{2}+5^{2}$, we only need to consider $1 \leqslant n \leqslant 16$.
The following positive integers have two (or more) different expressions:
$$
\begin{array}{l}
4=2^{2}=1^{2}+1^{2}+1^{2}+1^{2}, \\
5=1^{2}+2^{2}=1^{2}+1^{2}+1^{2}+1^{2}+1^{2}, \\
8=2^{2}+2^{2}=1^{2}+1^{2}+1^{2}+1^{2}+2^{2}, \\
9=3^{2}=1^{2}+2^{2}+2^{2}, \\
10=1^{2}+3^{2}=1^{2}+1^{2}+2^{2}+2^{2}, \\
11=1^{2}+1^{2}+3^{2}=1^{2}+1^{2}+1^{2}+2^{2}+2^{2}, \\
12=1^{2}+1^{2}+1^{2}+3^{2}=2^{2}+2^{2}+2^{2}, \\
13=1^{2}+1^{2}+1^{2}+1^{2}+3^{2}=1^{2}+2^{2}+2^{2}+2^{2}, \\
14=1^{2}+2^{2}+3^{2}=1^{2}+1^{2}+2^{2}+2^{2}+2^{2}, \\
16=4^{2}=2^{2}+2^{2}+2^{2}+2^{2} .
\end{array}
$$

While the positive integers $1,2,3,6,7,15$ have only one unique expression:
$$
\begin{array}{l}
1=1^{2}, 2=1^{2}+1^{2}, 3=1^{2}+1^{2}+1^{2}, 6=1^{2}+1^{2}+2^{2}, \\
7=1^{2}+1^{2}+1^{2}+2^{2}, 15=1^{2}+1^{2}+2^{2}+3^{2} .
\end{array}
$$

Therefore, the required positive integers $n$ are $1,2,3,6,7,15$.