<s>[INST] Probability of a sum being divisible by $4$ Roll $n$ six-sided dice.
What is the probability that the sum of the results is divisible by $4$?
This is an 11th grade problem, and I really don't know -after a lot of searching-what tools do I need to solve this problem using only high school knowledge.
 [/INST] I'm not quite sure that generating functions and some complex numbers are included in 11th grade (not sure what it corresponds to in Sweden), but you can get a closed solution for each value of $n$ if you know about these. Even though I suspect this is too complicated.
Let the generating function be
\begin{equation}
f_n(x) = (x+x^2+x^3+x^4+x^5+x^6)^n
\end{equation}
For two dices, expanding $f_2(x)$ gives
\begin{equation}
f_2(x) = x^2+2x^3+3x^4+4x^5+5x^6+6x^7+5x^8+4x^9 +3x^10+2x^{11}+x^{12}
\end{equation}
here, it is the coefficients of $x^4,x^8$ and $x^{12}$ which are interesting, the sum of these corresponds to the number of outcomes which are divisible by four. Summing up, we see that for two dices, there are $3+5+1=9$ ways to get a sum divisible by four.
Now, define the number $\zeta = e^{\pi i/2}$. This has a periodicity of $4$, e.g. $\zeta^1 = \zeta^5$. If you expand $f_n(x)$, you get $f_n(x) = \sum_{k=0}^{6n} c_kx^k$, so here we want to try to extract the coefficients of interest, i.e. $c_4,c_8,c_{12}, ...$.
If you now look at the function $g_k(x)=x^k, k=0,1,2,3,...$, note that
\begin{align} 
g_0(\zeta^0) + g_0(\zeta^1) + g_0(\zeta^2) + g_0(\zeta^3) &= 4 \newline
g_1(\zeta^0) + g_1(\zeta^1) + g_1(\zeta^2) + g_1(\zeta^3) &= 0 \newline
g_2(\zeta^0) + g_2(\zeta^1) + g_2(\zeta^2) + g_2(\zeta^3) &= 0 \newline
g_3(\zeta^0) + g_3(\zeta^1) + g_3(\zeta^2) + g_3(\zeta^3) &= 0 \newline
g_4(\zeta^0) + g_4(\zeta^1) + g_4(\zeta^2) + g_4(\zeta^3) &= 4 \newline
\end{align}
and so on. As you can see, we extract the correct coefficients. This means that we have that the number of possible ways $N$ to have a sum divisible by four is given by
\begin{equation}
N = \frac{1}{4} \sum_{k=0}^3 f_n(\zeta^k) 
\end{equation}
Calculating gives
\begin{align}
f_n(\zeta^0) &= 6^n \newline
f_n(\zeta^1) &= (-1+i)^n \newline
f_n(\zeta^2) &= 0 \newline
f_n(\zeta^3) &= (-1-i)^n
\end{align}
such that
\begin{equation}
N = \frac{1}{4} \sum_{k=0}^3 f_n(\zeta^k) = \frac{1}{4} \left(6^n + 2^{n/2+1} \cos\left(\frac{3\pi n}{4} \right) \right)
\end{equation}
The first few terms give that the number of total outcomes which are divisible by four are then $N=1,9,55,322,1946$ for $n=1,2,3,4,5$. These are the same I got when expanding the generating functions so I think things match up, even though I'm seldom certain.
Furthermore, since you asked about the probability, the total number of outcomes are $6^n$, the probability for the sum being divisible by four, is given by
\begin{equation}
P_n = \frac{1}{4} \left(1 + \frac{2^{n/2+1}}{6^n} \cos\left(\frac{3\pi n}{4} \right) \right)
\end{equation}
Finally, note that $P_n\rightarrow 1/4$ when $n\rightarrow \infty$.
</s>