6.71. Find the sum of the squares of the lengths of all sides and diagonals of a regular $n$-gon inscribed in a circle of radius $R$.
6.71. Let $S_{k}$ denote the sum of the squares of the distances from vertex $A_{k}$ to all other vertices. Then

$$
\begin{aligned}
S_{k}= & A_{k} A_{1}^{2}+A_{k} A_{2}^{2}+\ldots+A_{k} A_{n}^{2}= \\
& =A_{k} O^{2}+2\left(\overrightarrow{A_{k} O}, \overrightarrow{O A}_{1}\right)+A_{1} O^{2}+\ldots+A_{k} O^{2}+2\left(\overrightarrow{A_{k} O}, \overrightarrow{O A}_{n}\right)+A_{n} O^{2}=2 n R^{2}
\end{aligned}
$$

since $\sum_{i=1}^{n} \overrightarrow{O A}_{i}=\overrightarrow{0}$. Therefore, $\sum_{k=1}^{n} S_{k}=2 n^{2} R^{2}$. Since the square of each side and diagonal appears twice in this sum, the desired sum is $n^{2} R^{2}$.