It is said that mathematical algorithms aren't patentable. Sometimes it is not too clear what exactly constitutes a mathematical algorithm. If I have a powerful and unique technique/ process/ methodology (algorithm?) "invented" to perform a certain important calculation (on a hardware because of its intensive nature) that will be subsequently used to perform something valuable based on its output values, can that technique/ process/ methodology (algorithm?) and its usage be patented (or is it not patent eligible). It is a unique and powerful technique. If not patent eligible, society may not reap the benefits of my invention as I may not attempt patenting it, and hold back on it. And, that defeats the whole patent purpose. I am not sure if I should proceed to patent -- time, energy, and costs are high. I am a private individual and my methodology etc. is based on my personal research work at home, developing and testing the technique.
It's a complicated answer, but what's important to understand is that software-related inventions and inventions based on an algorithm CAN indeed be patentable in the U.S. The "how" of patenting such inventions has changed substantially in recent years and is still evolving, so it's critical to work with a patent attorney, especially for technology in this field.
This post discusses the patentability of software and software related inventions in more detail and also applies to algorithm-based inventions:
As for whether you should proceed with a patent, talk with a patent attorney first before making a decision. Just because software related inventions and inventions based on an algorithm can be patented, does not mean that yours necessarily is.
Algorithm-based inventions may be patentable, but algorithms are not patentable in the US, because an algorithm is an abstract idea that can be performed in your head. (This is an old discussion that I'm not interested in having again.) One can obtain a patent on technology that uses an algorithm, if the "invention" is a technological solution that is not an abstract idea. The US has moved towards the problem-solution ideal of the EPO, but the US is not quite there yet. Problem-solution can help frame an invention for the USPTO (and can help limit prior art in some obviousness rejections). If you want to test if you can likely patent your "invention" using a method claim, start by writing down your "invention" as a series of steps. Don't conceptualize any of the steps, write them out completely. What I mean by that is this: Don't write the idea or purpose of any step, write the actual action to be taken to obtain the purpose of that step. If there is something tangible in one of your steps, something that can be touched, AND that step involves more than prior art elements, then you may be able to patent your "invention." You may be better off keeping your algorithm as a trade secret. It's hard to say without knowing more about your "invention," something you should not be putting on sites like this.