Kloosterman Sum Approximation
Evaluate finite Kloosterman exponential sum over invertible residues modulo caller m, using exact modular inverses and floating complex phases; nonunits are omitted, not assigned inverses.
Description
A Kloosterman sum uses both a residue and its modular inverse in each exponential phase.
A Kloosterman sum uses both a residue and its modular inverse in each exponential phase. Only invertible residues contribute.1
Evaluate finite Kloosterman exponential sum over invertible residues modulo caller m, using exact modular inverses and floating complex phases; nonunits are omitted, not assigned inverses.
When to use Kloosterman Sum Approximation
Use this tool to evaluate finite Kloosterman exponential sum over invertible residues modulo caller m, using exact modular inverses and floating complex phases; nonunits are omitted, not assigned inverses.
Choose the integer, sequence, coefficients or function parameters for your calculation. Follow the stated ordering, domain and size limits.
How to use Kloosterman Sum Approximation and understand its results
- Choose the integer, sequence, coefficients or function parameters for your calculation. Follow the stated ordering, domain and size limits.
- Enter coefficientA, coefficientB, modulus using the field table and calculation rules, then run the tool.
- Read finiteKloostermanRealPart, finiteKloostermanImaginaryPart, unitResidueCount. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| coefficientA | Coefficient a | number | Required |
| coefficientB | Coefficient b | number | Required |
| modulus | Modulus | number | Required |
Use integer modulus 2–10,000 and signed integer coefficients of magnitude ≤one million. Iterate residues 1 through m−1, compute exact modular inverses and accumulate cosine/sine phases. Return real and imaginary parts and unit-residue count.
sum = Σ[gcd(r,m)=1]exp(2πi(ar+b r⁻¹)/m) Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| finiteKloostermanRealPart | Finite kloosterman real part | number |
| finiteKloostermanImaginaryPart | Finite kloosterman imaginary part | number |
| unitResidueCount | Unit residue count | number |
{
"input": {
"coefficientA": 1,
"coefficientB": 1,
"modulus": 3
},
"output": {
"finiteKloostermanRealPart": -1.0000000000000002,
"finiteKloostermanImaginaryPart": 2.220446049250313e-16,
"unitResidueCount": 2
}
} Limitations and assumptions
Phase evaluation is floating-point, despite exact integer inverses. Nonunit residues are omitted rather than assigned an inverse.
Numeric inputs and returned numeric values must be finite; an unrepresentable returned value produces an error. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use Gauss Sum Approximation: Evaluate finite quadratic Gauss sum Σ exp(2πi(ax²+bx)/m) over all residues, preserving complex output and exact BigInt phase reduction; distinct from Kloosterman inverse-residue phase. For a complementary task, use Wall-Sun-Sun Prime Checker: Check Fibonacci-Wieferich/Wall–Sun–Sun congruence F_(p−(5/p)) mod p² for actual primes other than 2 and 5 using exact modular doubling; excluded/nonprime inputs explicitly not applicable, no existence claim.
References
-
Kloosterman Sum Approximation — tool.io
Similar or alternative tools
- Gauss Sum Approximation
Evaluate finite quadratic Gauss sum Σ exp(2πi(ax²+bx)/m) over all residues, preserving complex output and exact BigInt phase reduction; distinct from Kloosterman inverse-residue phase.
- Wall-Sun-Sun Prime Checker
Check Fibonacci-Wieferich/Wall–Sun–Sun congruence F_(p−(5/p)) mod p² for actual primes other than 2 and 5 using exact modular doubling; excluded/nonprime inputs explicitly not applicable, no existence claim.