Maths & numbers

Dirichlet convolution and arithmetic function inverse calculator

Dirichlet convolution combines arithmetic functions by the divisors of an index, rather than by additive shifts.

Your numbers

Deconvolution solves B*h=A.
Integers or exact fractions, at most 128 entries.
Same length as A. Ignored in inverse mode.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Dirichlet convolution combines arithmetic functions by the divisors of an index, rather than by additive shifts. Input tables begin at n=1 and may contain exact fractions. The calculator supports convolution, inversion and deconvolution on one page, returning every index supported by the supplied finite tables. Inverse mode ignores B; deconvolution treats B as the denominator function and solves B convolved with h equals A.

THE FORMULA(f*g)(n)=Σ_(d divides n) f(d)g(n/d). Inversion requires f(1)≠0 and solves f*f^(−1)=ε.

A worked example

Convolve the constant-one table 1,1,1,1,1,1 with the Möbius values 1,−1,−1,0,−1,1. At n=6 the divisor contributions are 1−1−1+1=0; the result table is 1,0,0,0,0,0. This is the Dirichlet identity ε. The same Möbius table is obtained by choosing inverse mode with A equal to the constant-one function.

Good to know

Each table has 1–128 entries beginning at index 1; noninverse operations require matching lengths. Values are integers or integer fractions with nonzero denominators. Inverting a function requires its first value to be nonzero. Fractions remain exact under a 4,096-digit intermediate growth cap. This is not continuous convolution, signal cross-correlation or a Fourier transform.

The divisor index changes the meaning of convolution

At index six the only divisor pairs are (1,6),(2,3),(3,2),(6,1). An additive convolution would instead sum pairs whose indices add to six, which is a different operation. Listing the function values from one rather than zero is therefore essential. The first input token is f(1), not a constant term at index zero.

The constant-one arithmetic function has value one at every positive integer, but it is not the convolution identity. The identity ε has value one at index one and zero elsewhere: among the divisor terms, only d=n survives when ε(n/d) is used. This explains why convolving two constant-one functions produces the divisor-count function instead of another constant table.

Divisor pairs at index six cancel in the one convolved with Möbius example1 × 6+12 × 3−13 × 2−16 × 1+1At n = 6: 1 − 1 − 1 + 1 = 0
The divisors 1,2,3,6 pair with 6,3,2,1. Multiplying constant-one values by Möbius values contributes +1,−1,−1,+1, totaling zero. These are divisor pairs rather than indices adding to six.

The Möbius function calculator evaluates the special inverse of the constant-one arithmetic function. This page accepts general rational arithmetic-function tables.

A nonzero first entry makes the inverse recursive

The index-one equation f(1)g(1)=1 determines g(1). For n>1, the equation Σ f(d)g(n/d)=0 contains f(1)g(n) plus terms involving only smaller g indices. Moving those known terms to the other side and dividing by f(1) determines the next inverse value. A zero f(1) makes the identity equation impossible over rational values.

For f(n)=1, this recursion is Möbius inversion. More general inputs need not be integer valued or multiplicative, so assuming prime-factor formulas would be wrong. The engine follows the divisor recursion for the actual supplied table. Fractions such as 1/2 are retained as rational pairs rather than approximated by decimals that could spoil an exact cancellation.

Finite input tables still give complete finite answers

To compute an output at n≤N, only values whose indices divide n are needed, and every such index is also at most N. A table through N therefore determines the entire result through N without guessing any later function values. Nothing in the output claims a continuation beyond the entered range.

Deconvolution is labeled with an equation because operand order is easy to misread: the displayed result h satisfies B*h=A. For example, if A is the divisor-count table and B is constant one, h is constant one. Use the result table and an independent convolution to verify this identity. A length mismatch is rejected instead of padding missing entries with unexplained zeros.

A few questions, answered

Are decimals accepted?

Use exact integer fractions such as 1/2. This page intentionally avoids approximate decimal parsing for arithmetic-function identities.

Can I calculate the inverse without Table B?

Choose inverse mode. Table B is ignored; only A and its nonzero value at index one determine the inverse.

Find your calculator

Start typing to explore the library.