Aren't computer programs mathematical equations? Any program can be
represented mathematically. . . . But how are programs different from
mathematical equations? . . . Don't encryption algorithms precisely
come under the definition of mathematical equations?
In the context of patent law, the "mathematical equations" that aren't patentable are those that are discovered and are mathematical laws of Nature.
For example, you cannot patent a mathematical equation which is the equivalent of the Fundamental Theorem of Algebra (which tells you how many solutions there are to all possible polynomial equations), because it is a statement about what is fundamentally true about something, not about how to do something that works better than other possible ways of doing something.
An algorithm, in contrast, in patent law, is a method of doing something that is not inherently the only way of doing something as a consequence of the laws of mathematics or other laws of Nature (although it could very well be the "best" way of doing something).
For example, the simplex method of linear programming would probably be patentable if it hadn't been publicly disclosed prior to anyone obtaining a patent on this method.
Most computer programs are the digital embodiment of algorithms, rather than of equations that were discovered that represent fundamental truths that are always and uniquely true about numbers or reality.
Notably, recent governing U.S. Supreme Court case law has now made it categorically true that there mere fact of embodying an algorithm or other business method in digital form with a computer program, as a matter of law, does not make an idea that would not be patentable if not embodied in a computer program patentable. The underlying idea that is embodied digitally in a computer program must, itself, be patentable.
A method for doing something, even if it can be or is represented mathematically, is not inherently not subject to being patented. But, not every method of doing something is patentable either. The "business method" must still clear the hurdles of being original (you can't patent ideas that have already been disclosed publicly by someone else, or by yourself for that matter), of having "utility" rather than merely aesthetic value, and of not being obvious to a person of ordinary skill if the field in which the invention arises.
For example, anything that would follow as a lemma or corollary of an existing aspect of prior art would not be eligible for a patent either, even if it is novel and useful.
Now, there is some room for sophistry here.
For example, you could call a computer equation that calculated a Lorentz transform a method for calculating the relationship between two coordinate frames to which relativistic mechanics apply. But, because that relationship is a law of Nature which is always true, even if it isn't the only means to calculating that relationship, it would not be patentable even if it were not prior art.
I want to start a company that uses machine learning algorithms.
While it is a risky business model, it is worth considering that over the last 10-15 years the legal threshold necessary to patent a computer program has gotten much, much higher.
The Patent and Trademark Office used to routinely grant these applications, but due to a string of important statutory and case law changes, software patents are now denied at a very high rate, and existing software patents are routinely determined to be invalid in litigation.
If there is serious reason to doubt that an existing patent that would be important for your business is really patentable, you should consult a patent lawyer to consider the possibility of bringing an interpartes review action in the Patent and Trademark Office to have a previously issued patent revoked. This is an expensive and time consuming process, but it is much cheaper than losing a patent infringement lawsuit after having invested time and money into running a business using a patent you know to be infringing because you believe that it won't hold up in court.