<s>[INST] Modular arithmetic and probability $a$, $b$ and $c$ are chosen from $1$-$999$ with order and replacement, what is the probability that $a^2 + bc$ is divisible by $3$? (each choice is equally likely)
I split it up into 2 cases
$a^2$ has a remainder of $1$ while $bc$ has a remainder of $2$
$a^2$ has a remainder of $1$, $2/3$ of the time, $bc$ has a remainder of $2$ if $b$ and $c$ have $2$ and $1$. $(2/3 \times 1/3 \times 1/3)2$ (because $b$ and $c$ can be interchanged) = $4/27$
$a^2$ has a remainder of 0 while $bc$ has a remainder of $0$
$a^2$ has a remainder of $0$ $1/3$ of the time while $bc$ has a remainder of $0$ if $b$ or $c$ have remainders of $0$. probability $1/3 \times 1/3 \times 2 = 2/9$
$4/27 + 2/9 = 10/27$
Please tell me what i did wrong.
 [/INST] $b$ or $c$ have remainders of $0$ with probability $\frac{5}{9}$, rather than your $\frac13 \times 2$, since you have to take account of double counting the possibility they both do: $\frac13 \times 2 -\left(\frac13\right)^2 = \frac59$
That will turn your final calculation into $\frac4{27}+\frac5{27}=\frac13$
</s>