Now, you need each of the primes $31,13$ and $5$ to be a divisor of either $x$ or $x-1$. In other words you need the following: $x\equiv 1$ or $x\equiv 0 \bmod 5,13,31$
There are going to be $8$ possible solutions, each of them can be solved in an easy way, the only ones that are not possible are $x\equiv 0\bmod 5,13,31$ and $x\equiv1\bmod 5,13,31$ as they would give solutions $0$ and $1$ which are not permitted.
The other $6$ combinations will provide one working solution each.
I will work through one example, the others are analogous.
$x\equiv 0\bmod 5$
$x\equiv 1 \bmod 13$
$x\equiv 1\bmod 31$
write $x=5k$, now $5k\equiv 1\bmod 13$ and so $k\equiv 8\bmod 13$ (since $8$ is the inverse of $5\bmod 13$). From here $k=13j+8$ and so $x=5(13j+8)=65j+40$
Now write $65j+40\equiv 1 \bmod 31\implies 3j\equiv-39\bmod 32\implies 3j\equiv23\equiv -8\bmod 31$, multiplying by the inverse of $3\bmod 31$ which is $21\equiv-10$ yields $j\equiv80\equiv 18\bmod 31$. from here $j=31m+18$
and so $x=65(31m+18)+40=2015m+1210$.
So this combination gives $1210$ as an answer, only $5$ other combinations remain.