Proof: Given that $x$ is a positive integer, prove…

Given that x is a positive integer, prove that $f(x) = x^2 + x + 1$ will never be divisible by $5$.

I've tried a contrapostive proof so far: Assume $f(x)$ is divisible by $5$. Then, $x^2 + x + 1 = 5p$ for some integer $p$.

$x(x+1) + 1 = 5p$

Since $x(x+1)$ has to be even because an even number times an odd number if even, $x(x+1)$ is odd. Thus, p is odd (the product of 5 and an odd number is an odd number). Thus:

$x(x+1) + 1 = 5(2n+1)$ for some integer $n$.

$x^2 + x - (10n+4) = 0$.

I need to show that x is NOT an integer, but I'm not sure how to proceed from here. Help?

• Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. – José Carlos Santos Feb 18 '18 at 17:46
• You can try with induction. – user152715 Feb 18 '18 at 17:49
• Do you mean $f(x)=x^2 + x+1$ will never be divisible by five? – amWhy Feb 18 '18 at 17:51
• In this type of questions I used to work as follows: $\mathbb{N}$ can be splitted into sets of the form $\{5k\}, \{5k+1\}, \{5k+2\}, \{5k+3\}, \{5k+4\}$ replacing case by case in your formula, it-s easy to check that no one of them has remainder 0. – Valerin Feb 18 '18 at 18:09
• Hint: is (x−5) a factor of the polynomial? How does that help us? (Sorry for posting this as an answer earlier, btw) – Ranjeev Grewal Feb 18 '18 at 18:39

Check $$0^2+0+1\not\equiv0,$$
$$1^2+1+1\not\equiv0,$$
$$2^2+2+1\not\equiv0,$$
$$3^2+3+1\not\equiv0$$ and
$$4^2+4+1\not\equiv0.$$