It is true that math itself is not protected, because it has been deemed (and rightfully so) an abstract idea, but the use of math in other processes and inventions is different. If you or I come up with a useful process that includes a mathematical calculation as one of its essential steps, then that calculation can be patented as part of the process.
Just because algorithms are processed mathematically by a computer, doesn’t mean the results have any mathematical value. The electrical charges that zip around inside a computer only have value because we assign it to them, not because they have any inherent value of their own. A piece of software is usually not designed to make mathematical calculations for the purpose of obtaining numerical results, but rather to transform information represented numerically into other pieces of information that do have value to us.