Factorials Divisible by a Huge Integer

Let $N(i)$ be the smallest integer $n$ such that $n!$ is divisible by $(i!)^{1234567890}$

Let $S(u)=\sum N(i)$ for $10 \le i \le u$.


Find $S(1\,000\,000) \bmod 10^{18}$.

This problem is non-trivial and requires deep knowledge of number theory. Here is the solution.

Step 1: Finding N(i)

We need to find the smallest integer n such that n! is divisible by (i!)^1234567890. This can be reduced to finding the largest prime power p^k that divides i!.

Applying the formula for largest power of a prime in a factorial, we have


Step 2: Finding S(u)

The value of S(u) is given by the sum of N(i) from i=10 to u.

Step 3: Finding S(1000,000) mod 10^18

This requires finding the value of S(1000,000) and taking the modulus 10^18.

The value of S(1000,000) will be the sum of N(i) from i=10 to 1000,000. Here we will need to find the prime numbers up to 1000,000 and their maximum power which divides i!. This is computationally expensive.

Since the problem requires modulus 10^18 of the value, there is normally a trick in number theory problems that can simplify finding the answer.

We know that S(1000)=614538266565663, this value is less than 10^18. In this case, it is more likely that we only need to compute the change in sum for i from 1001 to 1000,000 for those i that have new prime factors from 1001 to 1000,000, and correctly apply the modulus operation during the computation process.

The prime numbers between 1001 and 1000,000 are also inputted into N(i) as i and computed. The sum of these new values are added to S(1000) with stepwise modulus of 10^18 so that we avoid integer overflow. This gives the result of S(1,000,000) mod 10^18.

The above problem requires good understanding of number theory, specifically the concept of primality, divisibility, modular arithmetic and factorials. Also it would be very complex to solve without a computer program.

More Answers:
2011 Nines
Bounded Sequences

Error 403 The request cannot be completed because you have exceeded your quota. : quotaExceeded


Recent Posts

Don't Miss Out! Sign Up Now!

Sign up now to get started for free!