What this calculator does
This is a recreational number-theory search tool inspired by Fermat's Last Theorem. Fermat's theorem states that for integer \(n \ge 3\) there are no positive integers X, Y, Z with \(X^n + Y^n = Z^n\). This tool generalizes the left-hand side to a sum of n consecutive nth powers and tests the proposition: there exist no natural numbers a, b such that the sum of n consecutive nth powers starting at a equals \(b^n\), for \(n \ge 4\). For each exponent n in your range it searches every starting base a in your range and reports any (a, b) pair found, or prints "--" when none exists in that window.
How to use it
Enter the lowest and highest exponent n to test (\(n \ge 2\)) and the lowest and highest starting base a to test (\(a \ge 1\)). The tool loops over each n, and for each a it computes $$S = a^n + (a+1)^n + \cdots + (a+n-1)^n,$$ finds the integer nth root of S, and verifies it exactly with big-integer arithmetic. Note that searching wide ranges is slow, because S grows extremely fast.
The formula explained
The equation is $$\sum_{j=0}^{n-1}\left(a+j\right)^{n} = b^{n}.$$ To avoid floating-point false positives the tool computes S as an exact big integer, derives a candidate root b by bisection, then re-tests \(b-1\), \(b\) and \(b+1\) with the exact check \(b^n = S\). Known solutions exist for small n: \(n = 2\) gives \(3^2 + 4^2 = 5^2\) and \(20^2 + 21^2 = 29^2\); \(n = 3\) gives \(3^3 + 4^3 + 5^3 = 6^3\).
Worked example
Set nStart = 3, nEnd = 3, aStart = 1, aEnd = 10. At \(a = 3\): $$S = 27 + 64 + 125 = 216,$$ and the integer cube root of 216 is 6 with \(6^3 = 216\). The tool records \(n = 3 \rightarrow a = 3,\ b = 6\).
FAQ
Does this prove the proposition? No. It only searches a finite window for counterexamples; finding none does not constitute a proof.
Why does it allow n = 2 and n = 3? Those cases have known solutions, so the tool can demonstrate them even though the no-solution claim only targets \(n \ge 4\).
Why might it time out? The sum grows roughly like \(n \cdot (a + n)^n\), so big ranges create enormous numbers; keep ranges modest.