Yes and no.
I am answering this question from a legal standpoint for the US (other countries have different guidelines). For the US, “abstract ideas” such as mathematical equations and algorithms that are strictly a formula cannot be patented. However, you can patent software that utilizes algorithms that produces a product or other concrete result. Essentially, patents can’t be obtained for algorithms that simply perform mathematical operations.
To best understand your options, it would be ideal to discuss your situation completely with a patent attorney. On the surface, it seems as those your algorithm has a purpose, but it is always best to discuss the legalities of any potential patent as there are various steps in the process.
would be happy to connect you with an esteemed patent attorney that can walk you through the process. We offer affordable, flat-rates and flexible communication options. Check out our website to learn more.