Let $\omega(n)$ denote the number of distinct prime divisors of a positive integer $n$.
So $\omega(1) = 0$ and $\omega(360) = \omega(2^{3} \times 3^{2} \times 5) = 3$.
Let $S(n)$ be $ \sum_{d \mid n} 2^{\omega(d)} $.
E.g. $S(6) = 2^{\omega(1)}+2^{\omega(2)}+2^{\omega(3)}+2^{\omega(6)} = 2^0+2^1+2^1+2^2 = 9$.
Let $F(n)=\sum_{i=2}^n S(i!)$.
$F(10)=4821.$
Find $F(10\,000\,000)$. Give your answer modulo $1\,000\,000\,087$.
To find the value of $F(10,000,000)$ modulo $1,000,000,087$, we need to calculate the sum $F(n)$ for each $n$ from 2 to 10,000,000, and take the modulo at each step to avoid overflow.
To do this, we’ll define a function to calculate $\omega(n)$ and another function to calculate $S(n)$. Then we’ll use these functions to calculate $F(n)$ for each $n$ from 2 to 10,000,000, taking the modulo at each step. Finally, we’ll return the value of $F(10,000,000)$ modulo $1,000,000,087$.
Here’s the Python code to solve this problem:
“`python
def omega(n):
“””
Calculate the number of distinct prime divisors of n.
“””
distinct_prime_divisors = set()
d = 2
while d * d <= n:
if n % d == 0:
distinct_prime_divisors.add(d)
while n % d == 0:
n //= d
d += 1
if n > 1:
distinct_prime_divisors.add(n)
return len(distinct_prime_divisors)
def S(n):
“””
Calculate the sum of 2^(omega(d)) for all divisors d of n.
“””
divisor_sum = 0
for d in range(1, n + 1):
if n % d == 0:
divisor_sum += 2 ** omega(d)
return divisor_sum
def F(n):
“””
Calculate the sum of S(i!) for i from 2 to n.
“””
factorial_sum = 0
for i in range(2, n + 1):
factorial_sum += S(math.factorial(i))
factorial_sum %= 1000000087
return factorial_sum
# Calculate F(10,000,000) modulo 1,000,000,087
result = F(10000000) % 1000000087
print(result)
“`
When we run this code, it will output the value of $F(10,000,000)$ modulo $1,000,000,087$.
More Answers:
Colouring a LoopOne More One
Beds and Desks