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
Fermat's theorem on sums of two squares modulo 4, and none of them can be expressed as the sum of two squares. This is the easier part of the theorem, and follows immediately from the observation that all squares are congruent to 0 or 1 modulo 4. Albert Girard was the first to make the observation, describing all positive integral numbers (not necessarily primes) expressible as the sum of two squares of positive integers; this was published in 1625. The statement that every prime "p" of the form "4n+1" is the sum of two squares is sometimes called "Girard's theorem". For his part, Fermat wrote an elaborate