My proof so far:Prove that if $\displaystyle p_1,...,p_n$ are the primes up to $\displaystyle \sqrt{n}$, and if each $\displaystyle p_i$ does not divide n, then n is prime.

$\displaystyle \frac{\sqrt{n}}{p_i}=ap_i+r$ where $\displaystyle a,r \in \mathbb{Z}-\{0\} \ , \ a,r \neq 0$.

$\displaystyle \frac{\sqrt{n}}{p_i}=ap_i+r \Rightarrow \ \sqrt{\frac{n}{p_i}}=ap_i+r \Rightarrow \ \frac{n}{p_i}=(ap_i+r)^2=a^2p_i^2+2arp_i+r^2$

From here it's easy to see that my working can be rearranged to get $\displaystyle n=p_i(a^2p_i^2+2arp_i+r^2)$ showing that n is divisible by $\displaystyle p_i$.

This is annoying since I want to show that n is prime!