 TOPICS # Fermat's 4n+1 Theorem

Fermat's theorem, sometimes called Fermat's two-square theorem or simply "Fermat's theorem," states that a prime number can be represented in an essentially unique manner (up to the order of addends) in the form for integer and iff or (which is a degenerate case with ). The theorem was stated by Fermat, but the first published proof was by Euler.

The first few primes which are 1 or 2 (mod 4) are 2, 5, 13, 17, 29, 37, 41, 53, 61, ... (OEIS A002313) (with the only prime congruent to 2 mod 4 being 2). The numbers such that equal these primes are (1, 1), (1, 2), (2, 3), (1, 4), (2, 5), (1, 6), ... (OEIS A002331 and A002330).

The theorem can be restated by letting then all relatively prime solutions to the problem of representing for any integer are achieved by means of successive applications of the genus theorem and composition theorem.

Choquet Theory, Diophantine Equation--2nd Powers, Eisenstein Integer, Euler's 6n+1 Theorem, Fermat's Little Theorem, Sierpiński's Prime Sequence Theorem, Square Number

## Explore with Wolfram|Alpha ## References

Conway, J. H. and Guy, R. K. The Book of Numbers. New York: Springer-Verlag, pp. 146-147 and 220-223, 1996.Hardy, G. H. and Wright, E. M. An Introduction to the Theory of Numbers, 5th ed. Oxford, England: Clarendon Press, pp. 13 and 219, 1979.Séroul, R. "Prime Number and Sum of Two Squares." §2.11 in Programming for Mathematicians. Berlin: Springer-Verlag, pp. 18-19, 2000.Shanks, D. Solved and Unsolved Problems in Number Theory, 4th ed. New York: Chelsea, pp. 142-143, 1993.Sloane, N. J. A. Sequences A002313/M1430, A002330/M000462, and A002331/M0096 in "The On-Line Encyclopedia of Integer Sequences."

## Referenced on Wolfram|Alpha

Fermat's 4n+1 Theorem

## Cite this as:

Weisstein, Eric W. "Fermat's 4n+1 Theorem." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Fermats4nPlus1Theorem.html