US Copyright law:
https://www.law.cornell.edu/uscode/text/17/102 (b)In no case does copyright protection for an original work of authorship extend to any idea, procedure, process, system, method of operation, concept, principle, or discovery, regardless of the form in which it is described, explained, illustrated, or embodied in such work.
Thus, if it is simply the description of the algorithm to accomplish a process, it isn't copyrightable (functional processes are the domain of patent law, not copyright). But creative ways of describing an idea or process could be copyrighted...
Further discussion https://www.copyright.gov/circs/circ33.pdf https://www.iusmentis.com/copyright/software/protection/