Divisibility by $10^6$? Let $p_k$ be the $k^{th}$ prime number. 

Find the least $n$ for which $(p_1^2+1)(p_2^2+1) \cdots (p_n^2+1)$ is divisible by $10^6$.

I have no idea where to start on this problem. Any help would be appreciated.
For each prime above $2$, $p^2+1$ is even. For $2^2+1=5$ so we only need to look for the first $5$ odd primes so that $5\mid p^2+1$.

$p^2\equiv-1\pmod{5}\iff p\in\{2,3\}\pmod{5}$. Scanning the primes: $3,7,13,17,23$ are the first $5$ so that $p\in\{2,3\}\pmod{5}$. Therefore, the product
$$
(2^2+1)(3^2+1)(5^2+1)\dots(23^2+1)
$$
will be divisible by $10^6$. If some $p^2+1$ is divisible by $25$, you may need fewer terms. Indeed, $7^2+1=50$, so we only need 
$$
(2^2+1)(3^2+1)(5^2+1)\dots(17^2+1)
$$
if you want to solve $p_k^2+1\pmod 5=0$

$p_k^2+1-5\pmod 5=0$

$p_k^2-4\pmod 5=0$

$p_k^2-4=5q$

find the prime such that 

$(p_k-2)(p_k+2)=5q$

so $p_k=5k+2$

or $p_k=5k-2$