Actually, Roger, whether patenting mathematics is against the law is a matter of the law in a particular country. The rules are not the same everywhere. An internatonal conventions on patent law doesn't apply in countries which haven't both signed up to the conventionand formally ratified it. In fact international law in general may not apply in a particular territory. Even something which is regarded as pretty much fundamental international law may or may not be applicable in a particular country.
Patent laws are not though of generally as something particularly fundamental, so patent laws are very much local. But even something as funcamental as the Geneva Convention and its additional protocols are nowhere near universal. As for the Geneva convention, UK has signed and ratified the four 1949 conventions, the three subsequent protocols, and committed to the Protocol I article 90 declaration, while the USA has signed and ratifuied the four 1949 conventions, signed protocols I and II but ratified neither, signed and ratified protocol III, and not accepted the Protocol I article 90 declaration (ie they alone will decide what the bits they've ratified mean - ie they have committed to nothing that they can be held to). So you can see that even the most fundamental international conventions have no relevance at all in the USA (there's lots of other evidence for that as well) so there's no imaginable reason to believe that mathematics isn't patentable there (or indeed anywhere where it isn't specifically written into the local national law).
And prior art is also irrelevant in many countries (specifically for example in Germany, where the courts determined that rounding corners on a rectangle in a dozent products antedating Apple's devidce by a decade or more didn't prevent them from holding an exclusive right to use that shape; and also in theUSA except on the rare occassions where someone has enough money to figght the big guys in court and the court possesses sufficient brain cells to recognise that the USPO fucked up when granting the patent).
Personally, I'm inclined (unlike Steve) to agree mostly with Richard Stallman on software patents, at least to the extent that a software patent should be valid only as a patent for using a specific technique to achieve a specific product and also excluding software that just uses pure mathematics to provide extreme performance for something that could in principle be done by hand (like the first public key encryption patent). At times I even think that RS doesn't go far enough.
But given the current ridiculous patent law situation I have produced (in collaboration with a colleague) patent applications for a pair of softwre algorithms because if I disn't do things like that my employer might go bust - because of the ridiculous European and American patent laws that will allow some other company to patent it; this is particularly necessary because the US courts will usually uphold a patent even if plentiful prior art can be demonstrated, so it would be insane while working in industry to publish research before applying for a patent on exploiting it.