Are we talking about the implementation is patented? Or the algorithm itself is patented?
You can't patent an algorithm, at least not in the U.S. The expression of an algorithm can be patented. Patent lawyers often tell people to replace an algorithm with a system, which is an expression of the algorithm.
Patents tend to be written like "any system that implements algorithm X" and "any machine-readable medium containing software that implements algorithm X", which is equivalent to a patent on the algorithm itself.
You can't patent an algorithm, at least not in the U.S. The expression of an algorithm can be patented. Patent lawyers often tell people to replace an algorithm with a system, which is an expression of the algorithm.