Pythagoreanism to have survived as part of, or deeply influenced, the Bacchic cults and Orphism. Pythagoras was already in ancient times well known for the mathematical achievement of the Pythagorean theorem. Although the Babylonians had used this formula for centuries, Pythagoras had discovered that "in a right-angled triangle the square of the hypotenuse is equal to the squares of the other two sides". In ancient times Pythagoras was also noted for his discovery that music had mathematical foundations. Antique sources that credit Pythagoras as the philosopher who first discovered music intervals also credit him as the inventor of the monochord, a
Legendre's three-square theorem 1 or 2 mod 4 is a sum of 3 squares, because any positive integer not divisible by 4 can be reduced to this form by subtracting 0 or 1 from it. However, proving the three-square theorem is considerably more difficult than a direct proof of the four-square theorem that does not use the three-square theorem. Indeed, the four-square theorem was proved earlier, in 1770. Legendre's three-square theorem In mathematics, Legendre's three-square theorem states that a natural number can be represented as the sum of three squares of integers if and only if is not of the form formula_2 for