Generating key points…
Answers are grounded in this paper and cite their sources.
When do a residue count and a necklace count agree exactly? For integers \(n≥1\), \(0≤ k≤ n\), \(0≤ r<n\) and \(q≥2\), let \(S\) count size-\(k\) multisets of \(\{1,…,n\}\) whose entries sum to \(r\) modulo \(n\) and whose multiplicities are at most \(q-1\). Let \(N\) count length-\(n\) words over \(\{0,…,q-1\}\), up to cyclic rotation, whose entries sum to \(k\) and whose co-period divides \(r\). The co-period is \(n\) divided by the least positive rotation that fixes the word, so it counts the repetitions of its shortest block. The classification gives a closed arithmetic test for prime \(q\) and an exact finite test for composite \(q\), answering the question in its full stated domain. Dougherty-Bliss and Elizalde, §6, Problem 6.6 Put \(h=(n,k)\) and \(G=(h,q)\). The equality conditions are as follows. If \(k=0\), both counts are \(1\) at \(r=0\) and \(0\) otherwise. For \(q=2\) and \(k>0\), equality holds exactly when at least one of these conditions holds: \(n\) is odd, \(k\) is odd, \(ν_2(n)<ν_2(k)\), \(r>0\) and \(ν_2(k)-ν_2(r)≥2\), or \(n=k\) is even and \(r∉\{0,n/2\}\). Here \(ν_2(b)\) is the exponent of \(2\) in the positive integer \(b\); the fourth condition is stated with positive \(r\) so that no valuation of zero is needed. Original binary classification, Theorem 4.7 For \(q≥3\), equality always holds if \(k<q\) or \(G=1\). For odd prime \(q\), the only additional equality is at \(q=3\), \(n=k=6\), with \(r\) even. For composite \(q\) with \(G>1\) and \(k=q\), the counts differ. The exact difference at \(k=q\) is \(N-S=G 1G r-1\), where an indicator \( 1_A\) equals \(1\) when \(A\) holds and \(0\) otherwise. For composite \(q\) with \(G>1\) and \(k>q\), let \(p\) be the smallest prime dividing \(G\), \(ρ=(r,h)\) and \(u=(k-q)/p\). Equality holds exactly when \(n\) belongs to the set constructed below. For each fixed \((q,k,h,ρ)\), this set has at most \(u\) members, all in \(k≤ n<16k^4\). At every \(n≥16k^4\) in this case, \(N>S\) if \(p r\), and \(N<S\) otherwise. The original counting formulae in Theorems 5.1 and 5.2 give an exact expression for the difference. For each divisor \(d h\), write \(g=(d,q)\), \(a=q/g\), \(m=n/d\) and \(t=k/d\). With \([y^t]\) denoting coefficient extraction at degree \(t\), the expression is \[n(N-S)=∑d hc_d(r)[y^t](1-y)⁻ᵐ((1-y^q)^m-(1-y^a)ᵍᵐ). \] Here \(c_d(s)=∑e(d,s)eμ(d/e)\) is the Ramanujan sum. The Möbius function \(μ(b)\) is zero if \(b\) has a squared prime factor and is \((-1)^j\) if \(b\) is a product of \(j\) distinct primes, with \(μ(1)=1\). The terms with \(g=1\) or \(t<a\) vanish. In the remaining composite case, the term for \(d=p\) has strictly highest degree as a polynomial in the length. Beyond the cutoff it controls the sign because its coefficient polynomial is positive and its weight \(c_p(r)\) is \(p-1\) for \(p r\) and \(-1\) otherwise. To construct the exceptional set, use only divisors \(d h\) with \(g>1\) and \(dq/g≤ k\). For each such \(d\), keep \(t=k/d\) and compute two polynomial sequences in the indeterminate \(X\), one for \(b=q\) and one for \(b=q/g\). Start with \(V_0⁽ᵇ⁾(X)=1\), and for \(1≤ j≤ t\) set \[V_j⁽ᵇ⁾(X)=X∑ᵢ₌₁ʲ(j-1)ᵢ₋₁dⁱ⁻¹(1-q 1b i)Vⱼ₋ᵢ⁽ᵇ⁾(X), \] where \((s)_=s(s-1)⋯(s-+1)\) and \((s)_0=1\). Form the integer polynomial \[P(X)=∑_d c_d(ρ)k!/t!d^t(V_t(q)(X)-V_t(q/g)(X)), \] using the same divisors. The factorial ratio is integral because \(t!d^t\) is the product of the positive multiples of \(d\) up to \(k\). At an input length in the specified gcd class, \(P(n)=k!n(N-S)\). The polynomial \(P(X)/X\) has degree exactly \(u\). Set \(J=\{j∈ Z:k≤ j<16k^4,\ (j,k)=h\}\). The exceptional lengths are the roots of the monic polynomial \[Q[X]\!(P(X)/X,\ ∏j∈ J(X-j)). \] Equivalently, find the integer roots of \(P(X)/X\) and retain those in \(J\). The construction has polynomial bit cost in \(k\) in this range, and the resulting set can be reused for every \(n,r\) with the same \(h,ρ\). For example, at \(q=6\), \(k=h=15\) and \(ρ=1\), the polynomial is \(-8072064000X^2(X-3)(X-15)\). Each other possible \(ρ\) changes it only by a nonzero scalar. The only admissible root is \(n=15\), so at this length the counts agree for every residue.
No takes yet. Share an insight, caveat, or question.
Zixuan He (2026) studied this question.
Synapse has enriched 8 closely related papers on similar clinical questions. Consider them for comparative context: