divisibility of an expression by 30 let $g$ be a natural number how to show that $30$ divides $(-8 g^5+20 g^4-50 g^3+115 g^2-167 g+90)$? 
my guess:
$30$ divides $90$ so it is enough to show that $30|-8 g^5+20 g^4-50 g^3+115 g^2-167 g = g(-8 g^4+20 g^3-50 g^2+115 g-167) $ now if $30|g$ we are done, otherwise we have to show that
$30|-8 g^4+20 g^3-50 g^2+115 g-167$ , I don't know how to go further..

Note that for any $n\in\mathbb{Z}$, 
$$30\mid n\iff 2\mid n\text{ and }3\mid n\text{ and }5\mid n.$$
Then note that
$$-8g^5+20g^4-50g^3+115g^2-167g+90\equiv0+0+0+g^2+g+0\equiv g+g\equiv 0\bmod 2$$
because, by Fermat's Little Theorem, $g^2\equiv g\bmod 2$. Similarly,
$$-8g^5+20g^4-50g^3+115g^2-167g+90\equiv g^5+2g^4+g^3+g^2+g+0\equiv $$
$$g+2g^2+g+g^2+g+0\equiv 0\bmod 3$$
because $g^3\equiv g\bmod 3$, and
$$-8g^5+20g^4-50g^3+115g^2-167g+90\equiv 2g^5+0+0+0+3g+0\equiv $$
$$2g+0+0+0+3g+0\equiv 0\bmod 5$$
because $g^5\equiv g\bmod 5$.
Thus, we have shown that any number of the form $-8g^5+20g^4-50g^3+115g^2-167g+90$ is divisible by 2, 3, and 5, and therefore is divisible by 30.
