Cyclogenic Polynomials
A monic polynomial p(x) is n -cyclogenic if p(x)q(x) = x^n - 1 for some monic q(x) in Z[x], with n minimal. P_n(x) = sum of all n -cyclogenic polynomials. Q_N(x) = sum_(n=1)^N P_n(x). Given Q_10(2)...
Problem Statement
This archive keeps the full statement, math, and original media on the page.
A monic polynomial is a single-variable polynomial in which the coefficient of highest degree is equal to $1$.
Define $\mathcal{F}$ to be the set of all monic polynomials with integer coefficients (including the constant polynomial $p(x)=1$). A polynomial $p(x)\in\mathcal{F}$ is cyclogenic if there exists $q(x)\in\mathcal{F}$ and a positive integer $n$ such that $p(x)q(x)=x^n-1$. If $n$ is the smallest such positive integer then $p(x)$ is -cyclogenic.
Define $P_n(x)$ to be the sum of all $n$-cyclogenic polynomials. For example, there exist ten 6-cyclogenic polynomials (which divide $x^6-1$ and no smaller $x^k-1$): \begin{align*} &x^6-1&&x^4+x^3-x-1&&x^3+2x^2+2x+1&&x^2-x+1\\ &x^5+x^4+x^3+x^2+x+1&&x^4-x^3+x-1&&x^3-2x^2+2x-1\\ &x^5-x^4+x^3-x^2+x-1&&x^4+x^2+1&&x^3+1 \end{align*} giving $$P_6(x)=x^6+2x^5+3x^4+5x^3+2x^2+5x$$ <p>Also define</p> $$Q_N(x)=\sum_{n=1}^N P_n(x)$$ It's given that $Q_{10}(x)=x^{10}+3x^9+3x^8+7x^7+8x^6+14x^5+11x^4+18x^3+12x^2+23x$ and $Q_{10}(2) = 5598$.
Find $Q_{10^7}(2)$. Give your answer modulo $1\,000\,000\,007$.
Problem 797: Cyclogenic Polynomials
Mathematical Analysis
An -cyclogenic polynomial divides in and does not divide for any . The divisors of are products of cyclotomic polynomials for .
A monic divisor of is a product for some subset . It is -cyclogenic if is the minimal such value, meaning contains at least one for which is the smallest multiple.
Equivalently, the polynomial is -cyclogenic iff , where is the set of cyclotomic indices used.
is the sum over all subsets with of .
By Mobius inversion on the lcm condition, can be computed from the product structure of cyclotomic values .
Concrete Examples and Verification
See problem statement for verification data.
Derivation and Algorithm
The algorithm follows from the mathematical analysis above, implemented with appropriate data structures for the problem’s scale.
Proof of Correctness
Correctness follows from the mathematical derivation and verification against provided test cases.
Correctness
Theorem. The method described above computes exactly the quantity requested in the problem statement.
Proof. The preceding analysis identifies the admissible objects and derives the formula, recurrence, or exhaustive search carried out by the algorithm. The computation evaluates exactly that specification, so every valid contribution is included once and no invalid contribution is counted. Therefore the returned value is the required answer.
Complexity Analysis
Must handle the given input size. See analysis for specific bounds.
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 797: Cyclogenic Polynomials
* A monic polynomial $p(x)$ is $n$-cyclogenic if $p(x)q(x) = x^n - 1$ for some monic $q(x) \in \mathbb{Z}[x]$, with $n$ mi
*/
int main() {
printf("Problem 797: Cyclogenic Polynomials\n");
// See solution.md for algorithm details
return 0;
}
"""
Problem 797: Cyclogenic Polynomials
A monic polynomial $p(x)$ is $n$-cyclogenic if $p(x)q(x) = x^n - 1$ for some monic $q(x) \in \mathbb{Z}[x]$, with $n$ minimal. $P_n(x)$ = sum of all $n$-cyclogenic polynomials. $Q_N(x) = \sum_{n=1}^N
"""
print("Problem 797: Cyclogenic Polynomials")
# Implementation sketch - see solution.md for full analysis