There is really no such 'patents cannot cover math'. All patents do is cover algorithms. That is it. A series of steps to accomplish some goal. Since all algorithms can be expressed in math then all patents cover nothing but math, right?
Instead, what can be covered by patents is very arbitrary. Some times of scientific discoveries can be patented, but not other types, for example.
Don't try to make sense of it. There is no sense. The only thing you can do is get a lawyer who has the ability to to site court history and knows the lingo properly to tell you how likely you are infringing on something.