Problem 288

An enormous factorial

For any prime `p` the number N(`p`,`q`) is defined by
N(`p`,`q`) = _{n=0 to q} T_{n}*`p`^{n}

with T_{n} generated by the following random number generator:

S_{0} = 290797

S_{n+1} = S_{n}^{2} mod 50515093

T_{n} = S_{n} mod `p`

Let Nfac(`p`,`q`) be the factorial of N(`p`,`q`).

Let NF(`p`,`q`) be the number of factors `p` in Nfac(`p`,`q`).

You are given that NF(3,10000) mod 3^{20}=624955285.

Find NF(61,10^{7}) mod 61^{10}

**
These problems are part of
Project Euler
and are licensed under
CC BY-NC-SA 2.0 UK
**