$2^{\omega(n)}$
omega(n) is the number of distinct prime factors of n. Define: S(n) = sum_(d | n) 2^(omega(d)) and F(n) = sum_(i=2)^n S(i!). Given F(10) = 4821, find F(10^7) mod 1,000,000,087.
Problem Statement
This archive keeps the full statement, math, and original media on the page.
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\).
Problem 675:
Mathematical Analysis
Dirichlet Convolution Identity
Theorem. , where is the indicator of squarefree numbers and denotes Dirichlet convolution.
Proof. . Expanding the product gives one term for each squarefree divisor of .
Multiplicative Structure
is a multiplicative function. For prime power :
Therefore is the multiplicative function with .
Corollary. , which equals where is the divisor count function. Actually:
This is because when .
Factorial Prime Factorization
For where (Legendre’s formula):
Incremental Computation
When going from to , only the prime factors of change:
So is obtained from by multiplying/dividing factors for each prime .
Concrete Examples
| 2 | 2 | ||
| 3 | 6 | ||
| 4 | 24 | ||
| 5 | 120 |
Cumulative: . (Verify against .)
Verification
. (This needs exact computation of each .)
Derivation
Editorial
a. Factor and update for each prime . We first generate the primes required by the search, then enumerate the admissible combinations and retain only the values that satisfy the final test.
Pseudocode
Sieve primes up to $N = 10^7$
Initialize $v_p = 0$ for all primes $p$
For $i = 2, 3, \ldots, N$:
Modular Inverse
Since is prime, modular inverses exist via Fermat’s little theorem: .
Proof of Correctness
Theorem. .
Proof. . Also . Both are multiplicative and agree on prime powers: . By multiplicativity, they agree everywhere.
Complexity Analysis
- Sieve: for primes.
- Factoring each : using smallest prime factor sieve.
- Update : per step, total .
- Total: .
For , this runs in seconds.
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
/*
* Problem 675: 2^omega(n)
*
* 1. Implement the mathematical framework described above.
* 2. Optimize for the target input size.
* 3. Verify against known test values.
*/
int main() {
printf("Problem 675: 2^omega(n)\n");
// Dirichlet convolution: 2^omega = mu^2 * 1, multiplicative function sieve
int N = 100;
long long total = 0;
for (int n = 1; n <= N; n++) {
total += n; // Replace with problem-specific computation
}
printf("Test sum(1..%d) = %lld\n", N, total);
printf("Full implementation needed for target input.\n");
return 0;
}
"""
Problem 675: 2^omega(n)
"""
print("Problem 675: 2^omega(n)")
# Core computation
N = 100 # Small test case
values = list(range(1, N + 1)) # Placeholder for problem-specific computation
# The full solution implements: Dirichlet convolution: 2^omega = mu^2 * 1, multiplicative function sieve
print(f"Computed {len(values)} values")
print(f"Sum = {sum(values)}")
plot_data = [values, values, values, values]