Dedekind Psi Function
Return ψ(n)=n∏(p|n)(1+1/p) exactly using distinct prime factors, with ψ(1)=1 and trial division limited to n≤10¹².
Description
Dedekind’s psi function weights an integer by one plus the reciprocal of each distinct prime divisor.
Dedekind’s psi function weights an integer by one plus the reciprocal of each distinct prime divisor. Factor exponents affect the integer part, but each distinct prime contributes one multiplier.1
The tool returns value. The indexing and output conventions below determine how to read these values.
When to use Dedekind Psi Function
Use this for the following task: Return ψ(n)=n∏(p|n)(1+1/p) exactly using distinct prime factors, with ψ(1)=1 and trial division limited to n≤10¹². Use the input and output conventions below to reproduce the intended mathematical quantity.
How to use Dedekind Psi Function and understand its results
- Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
- Enter n according to the field table, then run the tool.
- Read value. Preserve exact decimal strings and the stated indexing or coefficient order.
- Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| n | Positive integer (trial-division resource limit 10^12) | integer; minimum 1; maximum 1000000000000 | Required |
Factor n and multiply p^(a−1)(p+1) for every prime power using BigInt. Return a decimal string, with ψ(1)=1.
ψ(n)=n×Π[p|n](1+1/p) The symbols and boundary conditions refer to the supplied fields and the implementation described above.
| Output field | Meaning | Value type |
|---|---|---|
| value | Dedekind psi value | string (integer/arbitrary) |
{
"input": {
"n": 12
},
"output": {
"value": "24"
}
} Limitations and assumptions
The input is capped at 10¹². This arithmetic Dedekind function is distinct from Chebyshev’s summatory function also denoted ψ.
Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.
Alternative or Complementary methods
Choose Jordan Totient Function when you need its operation: Return J_k(n)=n^k∏(p|n)(1−p^(−k)) exactly for positive order k≤128, with trial division limited to n≤10¹². Choose Chebyshev Psi Function for the complementary operation: Compute ψ(n)=Σ(p^k≤n)ln(p) over all positive prime powers with compensated addition and a prime sieve capped at n=1,000,000.
Background reference: OEIS A001615.
References
-
OEIS A001615 — OEIS Foundation
Similar or alternative tools
- Jordan Totient Function
Return J_k(n)=n^k∏(p|n)(1−p^(−k)) exactly for positive order k≤128, with trial division limited to n≤10¹².
- Chebyshev Psi Function
Compute ψ(n)=Σ(p^k≤n)ln(p) over all positive prime powers with compensated addition and a prime sieve capped at n=1,000,000.