Introduction to Möbius inversion for divisor sums
Möbius inversion turns a sum over divisors back into the sequence that created it. If one arithmetic function is built by adding values over the divisors of n, the Möbius function gives the weights needed to recover the underlying terms one index at a time. It is a compact idea, but it appears throughout elementary and analytic number theory because divisor sums often hide the original data.
This Möbius inversion calculator is built for that exact exchange. Choose the mode that matches the list you already have, enter the sequence in order, and let the page apply the divisor identity to the numbers you pasted. You can move between the cumulative divisor-sum form and the recovered form without expanding every divisor sum by hand.
The notes below explain which sequence belongs in the textarea, how to read the output, what the formulas mean, and where indexing mistakes usually appear. For Möbius inversion, the most important detail is not the size of the numbers but the order in which the terms are entered: the first item must correspond to n=1.
What Möbius inversion solves for divisor-sum data
The Möbius inversion problem is simple to state and easy to write incorrectly: if you know f(n)=∑d|n g(d), how do you recover g(n)? Möbius inversion answers that question by applying the Möbius function to the divisor lattice. The reverse mode on this page performs the matching cumulative sum when you already have g(n).
That makes the calculator useful for hand-checked examples, classroom exercises, and short exploratory sequences where you want to confirm that a formula written as a divisor sum really produces the values you expect. Instead of rewriting the identity for every n, paste a finite prefix and inspect the transformed list immediately.
If you know the source sequence but need its divisor sum, use the Provide g(n) mode. If you know the divisor-sum values but want the hidden sequence, use Provide f(n). The page does not guess which side you meant; choosing the direction explicitly keeps the interpretation clear.
How to use the Möbius inversion calculator
To use this Möbius inversion calculator reliably, enter a consecutive list beginning with the value at n=1, then select the direction of the divisor-sum transform. A short list is often the best first check because you can inspect its divisors independently.
- Enter one comma-separated value for each index from n=1 onward.
- Pick Provide f(n) when your list is the divisor-sum sequence you want to invert.
- Pick Provide g(n) when your list is the base sequence you want to accumulate over divisors.
- Click Compute to recalculate the matching sequence and update the results panel.
When the output changes, read it as a new sequence rather than as a single isolated total. Each entry corresponds to one positive integer index, so a comma matters as much as the number beside it. If you are checking a derivation, run a list in both directions and confirm that the returned prefix agrees with the original one.
Inputs for a correctly indexed Möbius inversion sequence
For Möbius inversion sequence input, the textarea accepts plain numeric values and treats the first entry as the term for n=1, the second as n=2, and so on. Because the method works through divisors of each index, a shifted list can produce a result that looks mathematically strange even when every individual number is correct.
- Indexing: keep the list consecutive so every value lines up with its positive integer index.
- Values: enter only the sequence values to transform; leave labels, notes, and headers out of the box.
- Order: preserve the same order used in your derivation or table, because inversion depends on position as well as magnitude.
- Units: arithmetic functions are commonly dimensionless, but any numeric units carried by g also carry through the linear sums in f.
If your source material starts at n=0 or mixes formatting with data, rewrite it before pasting. For this calculator, the first number is always the n=1 term, so a header row, a missing zero, or an off-by-one shift will ripple through every later result.
Formulas for Möbius inversion of divisor sums
The calculator uses the standard divisor-sum identities for arithmetic functions. In forward form, the sequence f(n) is the sum of g(d) over every divisor d of n. In reverse form, Möbius inversion recovers g(n) by weighting each divisor term with μ(n/d).
Those two lines describe the two radio-button modes in the form. The first equation is the inversion step used when you enter f(n); the second is the cumulative divisor sum used when you enter g(n). Because the same divisor can contribute to many later indices, a change at one early term often appears again at several multiples of that index.
The Möbius function μ(m) supplies the cancellation that makes the inversion work. It equals 1 at m=1, equals 0 when m has a repeated prime factor, and otherwise has a sign determined by the number of distinct prime factors of m. In particular, squarefree numbers with an even number of prime factors have μ(m)=1, while those with an odd number have μ(m)=−1. This alternating pattern strips away the overcounting introduced by the divisor sum.
Worked example: recovering a sequence with Möbius inversion
A concrete Möbius inversion example makes the indexing visible. Suppose the base sequence begins g(1)=1, g(2)=2, g(3)=3, g(4)=4, g(5)=5, and g(6)=6. In Provide g(n) mode, enter 1, 2, 3, 4, 5, 6. The divisor sums are f(1)=1, f(2)=1+2=3, f(3)=1+3=4, f(4)=1+2+4=7, f(5)=1+5=6, and f(6)=1+2+3+6=12.
The resulting list is therefore 1, 3, 4, 7, 6, 12. Now switch to Provide f(n), paste that result, and compute again. At n=6, the inverse calculation is especially instructive: only divisors 1, 2, 3, and 6 occur, and the weights are μ(6)=1, μ(3)=−1, μ(2)=−1, and μ(1)=1. The calculation 1·f(1) − f(2) − f(3) + f(6) gives 1 − 3 − 4 + 12 = 6, recovering g(6).
This example also shows why the output is a sequence, not one universal total. Each n has a different set of divisors. At n=5 only 1 and 5 contribute, while at n=6 the richer divisor structure creates several terms and requires Möbius cancellation to isolate the value at 6.
Sensitivity notes for Möbius inversion sequence entries
Möbius inversion is sensitive to position, not just value. Changing the term at index m affects every n whose divisor set includes m in the forward sum, and in the inverse direction the same term is filtered through the μ(n/d) weights attached to the matching divisors.
That is why the best way to compare scenarios is to change one index at a time and watch the nearby multiples. If you edit the term at m, check the output at 2m, 3m, and 4m as well as at m itself, because those are the places where the divisor relationship is easiest to see.
A structured comparison is more informative than a synthetic score for this topic. Möbius inversion is about arithmetic structure: which divisors appear, how often they appear, and how the Möbius signs cancel them. When the structure is correct, the output should reflect the same divisor pattern as the input data.
How to interpret Möbius inversion calculator results
Möbius inversion calculator results show the transformed sequence itself, not a symbolic derivation of every divisor contribution. Read the line as the companion list for the mode you chose: it is g(n) if you supplied f(n), or f(n) if you supplied g(n).
To judge whether the output is useful, check the sign pattern, the size of the terms, and whether the divisor relationships make sense for the sequence you entered. A surprisingly large or negative entry is not automatically an error, but it often means the list is shifted, a value was omitted, or the wrong direction was selected.
If the sequence behaves as expected on a few small indices, you can treat the output as a practical check of the identity. If it does not, revisit the order of the input first; for Möbius inversion, an off-by-one error is usually easier to fix than a mistaken formula.
Limitations and assumptions for finite Möbius inversion sequences
This Möbius inversion calculator works on finite comma-separated lists of numeric values. It does not infer symbolic formulas, fill in missing terms, or guess which side of the divisor identity you intended if the entries are out of order.
- Indexing assumption: the first value is treated as n=1, so every later entry depends on that starting point.
- Numeric input only: keep labels, notes, and headers out of the textarea so the sequence positions stay aligned.
- Finite prefix: the page transforms only the terms you enter, which makes it useful for short checks but says nothing about unentered indices.
- Floating-point arithmetic: exact integers are handled naturally at small sizes, but decimal input can display ordinary browser rounding.
- Proof versus check: the calculator is a numerical companion to a derivation, not a substitute for a proof when symbolic certainty is required.
If you are using the output to verify a theorem, treat the page as a fast consistency check. Derive the identity, test a few short sequences here, and then confirm that the divisor-sum behavior matches the sign pattern and cancellation expected from the Möbius function.
Further context: the Möbius function behind divisor-sum reversal
Möbius inversion is a standard way to reverse divisor sums in number theory. It starts from an arithmetic function that is formed by summing another function over the divisors of , typically written as . The inversion recovers by weighting each divisor contribution with .
The Möbius function itself takes the value 1 when is 1, vanishes if contains any squared prime factor, and equals when is squarefree with an odd number of prime factors. Its alternating signs are what make the cancellation work. For example, μ(12)=0 because 12 contains 2², whereas μ(30)=−1 because 30 has three distinct prime factors.
Applications of the inversion include combinatorial identities and multiplicative functions such as Euler’s totient. In number-theory problems, switching between a sum over divisors and a sum weighted by makes hidden relationships easier to inspect.
This calculator demonstrates the discrete form of Möbius inversion. Provide a list of values for (1) through (k) and it returns the corresponding (n) for each index. The browser-based script computes the Möbius function for the relevant divisors and performs the summations locally.
Try short sequences whose divisor structure is easy to follow, such as a prefix with a few zeros or a sequence that grows slowly, and watch how the inversion reshapes it. The exercise helps reveal how divisor sums encode information and why the Möbius function is an effective cancellation tool.
The form below lets you move back and forth between a summatory function and its underlying sequence. Enter one list as (n) to generate its cumulative form (n), then switch modes and paste the output back to confirm the inversion. If you want to compare runs later, copy the result text into your notes or spreadsheet.
Because divisor sums can grow quickly, double-check the index order and keep an eye on ordinary floating-point rounding when you work with longer lists. The mathematical identity is exact; any small decimal discrepancy comes from the way the browser represents non-integer input rather than from Möbius inversion itself.
