The Sieve of Eratosthenes has been cited in introductions to lazy functional programming for more than 30 years. In Haskell, the code is as follows
primes = sieve [2..] sieve (p : xs) = p : sieve [x | x <- xs, x ‘mod‘ p > 0]which is not that algorithm at all but in fact something significantly worse than trial division. The use of mod is a pretty big clue, and trial division is normally considered the most naive and inefficient way, so finding something even less efficient, and then teaching it for over thirty years, ... well.
Apparently one implementation (not Haskell, but that did not fare well either) was so inefficient that it would take "several seconds" to calculate the 19th prime (ie 71) .. words utterly fail me.