Remarquons d'abord que:
\begin{align*}
S & = 1 + \cos\frac{\pi}{3} + \cos\frac{2\pi}{3} + \cos\frac{3\pi}{3} + \cos\frac{4\pi}{3} + \cos\frac{5\pi}{3}\\
  & + \cos\frac{6\pi}{3} + \cos\frac{7\pi}{3} + \cos\frac{8\pi}{3} + \cos\frac{9\pi}{3} + \cos\frac{10\pi}{3} + \cos\frac{11\pi}{3} + \cdots
\end{align*}
\Par
Remarquons aussi que:
\Par
\begin{itemize}
\item $1+\cos\tfrac{3\pi}{3}=\cos\tfrac{6\pi}{3}+\cos\tfrac{9\pi}{3}=\cdots=\cos\tfrac{\numprint{2016}\pi}{3}+\cos\tfrac{\numprint{2019}\pi}{3} =0$

\item $\cos\tfrac{\pi}{3}+\cos\tfrac{2\pi}{3} = \cos\tfrac{7\pi}{3}+\cos\tfrac{8\pi}{3}=\cdots=\cos\tfrac{\numprint{2017}\pi}{3}+\cos\tfrac{\numprint{2018}\pi}{3}=0$

\item $\cos\tfrac{4\pi}{3}+\cos\tfrac{5\pi}{3} = \cos\tfrac{10\pi}{3}+\cos\tfrac{11\pi}{3}=\cdots=\cos\tfrac{\numprint{2020}\pi}{3}+\cos\tfrac{\numprint{2021}\pi}{3}=0$.
\end{itemize}

\Par

Ainsi, la somme se réduit à:
\begin{align*}
S & = \cos\frac{\numprint{2022}\pi}{3}+\cos\frac{\numprint{2023}\pi}{3}\\
  & = \cos(674\pi)+\cos\left(674\pi+\frac{\pi}{3}\right)\\
  & = 1 + \frac{1}{2}\\
  & = \frac{3}{2}.
\end{align*}
\newpage
