Möbius Inversion Calculator for Divisor-Sum Sequences
Introduction: why Möbius inversion matters 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.
This 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. That way you can move between the cumulative 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.
What Möbius inversion solves for divisor-sum data
The underlying 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, and 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, you can paste a short prefix and see the transformed list immediately.
If you know the source sequence but need the divisor sum, use the g(n) mode. If you know the divisor-sum values but want the hidden sequence, use the f(n) mode. The page does not guess which side you meant; you choose the direction explicitly so the interpretation stays clear.
How to use the Möbius inversion calculator
- 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 sequence and update the results panel.
When the output changes, read it as a new sequence, not as a single isolated total. Each entry corresponds to one index, so a comma in the input matters as much as the number beside it. If you are checking a derivation, run the same list in both directions and confirm that the two modes agree on the part of the sequence you expected to match.
Inputs: choosing the sequence values for Möbius inversion
The textarea accepts a plain numeric sequence, and the calculator treats the first entry as the term for n=1, the second as n=2, and so on. Because Möbius inversion works through divisors of each index, a shifted list can produce a result that looks mathematically strange even when the numbers themselves are correct.
- Indexing: keep the list consecutive so every value lines up with its positive integer index.
- Values: enter only the sequence values you want to transform; leave labels, notes, and headers out of the box.
- Order: preserve the same order you use in your derivation or table, because the inversion depends on position as well as magnitude.
- Testing: if you are unsure about a list, start with a short sequence whose divisors you can enumerate by hand.
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 or an off-by-one shift will ripple through every later result.
Formulas: Möbius inversion for divisor sums
The page 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 shows up again at several multiples of that index.
The Möbius function μ(m) supplies the cancellation that makes the inversion work. It is zero when m has a repeated prime factor, and otherwise its sign depends on how many distinct prime factors m has. That sign pattern is what strips away the overcounting introduced by the divisor sum.
Worked example (step-by-step Möbius inversion)
A useful way to test the calculator is to start with a short sequence you can reason about by hand. List the first few terms in order, then check how each divisor contributes when you switch between the two modes. The goal is to verify the indexing and the divisor structure, not to force a fake arithmetic total from unrelated inputs.
If the output surprises you, work through three questions before changing the formula: did you start at n=1, did you choose the correct direction, and did you keep every comma-separated value in the right position? Those are the usual causes of a result that looks wrong in a Möbius inversion check.
For a classroom-style sanity check, it often helps to choose a tiny prefix where the divisors are easy to list. Once you can see which terms appear at n=2, n=3, n=4, and n=6, the relationship between the two modes becomes much easier to trust.
Sensitivity notes: how one sequence entry affects Möbius inversion
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 neighboring 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 results
The results panel shows the transformed sequence itself, not a symbolic derivation of every divisor contribution. Read it as the companion list for the mode you chose: 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 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 Möbius inversion sequences
This 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 only transforms the terms you enter, which makes it ideal for short checks but not for unentered indices.
- Floating-point arithmetic: if your theory uses exact integers or rationals, the browser may still display ordinary decimal rounding.
- Proof versus check: the calculator is a numerical companion to a derivation, not a substitute for one when you need symbolic certainty.
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 you expect from the Möbius function.
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.
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 through and it returns the corresponding 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 you see how divisor sums encode information and why the Möbius function is such an effective cancellation tool.
The form above lets you move back and forth between a summatory function and its underlying sequence. Enter one list as to generate its cumulative form , 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.
