In the US you can patent algorithms/software. Although it's not necessarily easy to get one, or worth the effort.
Software qualifies for patent protection if it produces a useful and tangible result. For example, the USPTO will not issue a utility patent on a mathematical formula used in space navigation, but it may on software that translates equations and makes a rocket take off. (Copyrights are commonly used for software programs that don't qualify for a patent.)Software patents fall under the Utility Patent category, which are used to protect the functional part of machines or processes. But note that software may also be protected under copyright laws. Check out the United States Patent and Trademark Office website for more information.
Note: The above quote was taken from Page 126 of Kathleen R. Allen's book Launching New Ventures (4th edition).
Algorithms are patentable in the US and a number of other countries. This has been the case since the first patent was granted for lossless data-compression algorithms in 1985. Note this patent is so old that it has expired!
In 1977 and 1978, Jacob Ziv and Abraham Lempel published a pair of papers on a new class of lossless data-compression algorithms, now referred to as LZ77 and LZ78. In 1983, Terry Welch developed a fast variant of LZ78 which was named Lempel–Ziv–Welch (LZW).
Welch filed a patent application for the LZW method in June 1983. The resulting US patent, 4558302, granted in December 1985, was assigned to Sperry Corporation who subsequently merged with Burroughs Corporation in 1986 and formed Unisys. Further patents were obtained in the United Kingdom, France, Germany, Italy, Japan and Canada.
This is the famous patent which created such a fuss in the entire on line world. You had to license technology from Unisys to implement GIF (image) encoding or decoding.
In general, algorithms are not patentable. This is actually starting to be looked at in more detail. One article to look at is this one. It looks like the USPTO is considering some additional criteria for algorithms.
If it has been published already then the owner has the copyrights to the tangle form but not the implementation unless you can find a patent that it references.
I have conducted quite a bit of research on this issue for past clients. Tension arises in the legal sphere because coming up with a new mathematical formula isn't generally patentable. That same formula mayb become patentable if, taken as a whole, it rises to the level of a new, useful process or outcome in computer processing.
For staters, the federal governing provision requires any patentable invention to meet "statutory subject matter" rules. Set out in 35 U.S.C § 101, the relevant language states that, "Whoever invents or discovers any new and useful process, machine, manufacture, or composition of matter, or any new and useful improvement thereof, may obtain a patent therefor. . ." The invention also has to be non-obvious, as set forth in a subsequent section. (bold emphasis added).
At first glance it looks like algorithms should be patentable. However, the US Supreme Court has ruled that "laws of nature, natural phenomenon and abstract ideas" are not patentable (sometimes referred to as the Diehr ruling). This creates a gray area for mathmatical processes.
To defeat the limitations of the Diehr ruling, you must disclose enough information to the USPTO examiner to demonstrate that the algorithm produces a useful, novel result and is not just an abstract idea using the laws of nature (mathmatics).
Consider the Court's statement:"When a claim containing a mathematical formula implements or applies that formula in a structure or process which, when considered as a whole, is performing a function which the patent laws were designed to protect … then the claim satisfies the requirements of § 101. Where the invention or discovery is only of mathematics, the invention or discovery is not the "kind" of discovery the patent law was designed to protect and even the most narrowly drawn claim must fail."
For your particular issue - copyright protects the "expression" of an idea. Patents protect ideas.