Periodicity of discrete time signal: $ x\left [ n \right ] = \cos (\frac{\pi n^{2}}{8}) $ I need to find the periodicity of the following signal:

$$ x\left [ n \right ] = \cos \left(\frac{\pi n^{2}}{8}\right) $$  

Now I understand that the basic procedure to determine the periodicity is to find a $ N $ such that $$ x\left [ n \right ] = x\left [ n + N\right ] $$

I applied the procedure to the aforementioned signal and got the following results:
$$
\begin{aligned}
x\left[ n\right] &amp;= \cos \left(\frac{\pi n^{2}}{8}\right) \\ 
x\left[ n + N\right] &amp;= \cos \left(\frac{\pi (n + N)^{2}}{8}\right)\\
&amp;= \cos \left(\frac{\pi (n^{2} + 2nN + N^{2})}{8}\right)\\
&amp;= \Re \left \{\exp \left(i \frac{\pi (n^{2} + 2nN + N^{2})}{8}\right)  \right \}\\
&amp;= \Re \left \{\exp \left(i \frac{\pi n^{2}}{8}\right)\exp \left(i \frac{\pi 2nN}{8}\right)\exp \left(i \frac{\pi N^{2}}{8}\right)  \right \}
\end{aligned}
$$
Now for the signal to conform to $ x\left [ n \right ] = x\left [ n + N\right ]$: 
$$
\Re \left \{\exp \left(i \frac{\pi 2nN}{8}\right)\exp \left(i \frac{\pi N^{2}}{8}\right)  \right \} = 1
$$
$ \exp(i\omega) = 1 $ only when $ \omega = 2\pi k $ where $k$ is an integer. Hence:
$$
\frac{\pi 2nN}{8} = \frac{\pi N^{2}}{8} = 2\pi k
$$
Now logically I can see that if $ N = 8 $ the first term would be reduced to a multiple of $ 2\pi $ for all $ n $ and hence the fundamental period would be $ N = 8 $ but how would I go about proving this mathematically, that the minimum period is indeed 8? like what set of operations would I perform on:
$$
\frac{\pi 2nN}{8} = \frac{\pi N^{2}}{8} = 2\pi k
$$
to obtain $ N = 8 $?
You want to prove that $\frac{nN}{8}$ is an integer for any integer $n$. Consider $n=1$. Clearly, $N$ cannot be less than 8.

You also need to prove that $\frac{N^2}{16}$ is an integer. This means that $N$ is a multiple of 4. So, the smallest $N$ that meets both conditions is 8.