How to simplify: $f(x)=(2^a-1)(3^a-1)(4^a-1)...(x^a-1)\mod {m}$ How to simplify $f(x)$ for positive integers $a,m,x$ where $x>1$ and $m$ is a composition of two very large primes, such that factoring $m$ is not an option. $a$ is relatively small number that doesn't have common divider with $m$
$f(x)=(2^a-1)(3^a-1)(4^a-1)...(x^a-1)\mod {m}$
I have been trying to play with small numbers to see how this expression looks like and come with below examples, my goal is to be able to solve this for big numbers of $x$, at the moment I can only solve this recursively.
$$f(3)=(2^a-1)(3^a-1)=$$
$$-2^a - 3^a + 6^a + 1$$

$$f(4)=(2^a-1)(3^a-1)(4^a-1)=$$
$$2^a + 3^a + 4^a - 6^a - 8^a - 12^a + 24^a - 1$$

$$f(5)=(2^a-1)(3^a-1)(4^a-1)(5^a-1)=$$
$$-2^a - 3^a - 4^a - 5^a + 6^a + 8^a + 10^a + 12^a + 15^a + 20^a - 24^a - 30^a - 40^a - 60^a + 120^a + 1$$

This expression will be $0 \mod m\;$ in specific cases, for example if $x\ge m,$ because then one of the terms $n+i$ will be 1 $\pmod m,$ or if $a$ is a multiple of the Euler phi function $\varphi(m),$ because then $(n+i)^a\equiv 1 \pmod m$ for all $i.$ 
