Hacker News new | ask | show | jobs
by AncientPC 5007 days ago
That's more accurately described as memoization, as caching is a broader term.

Also, you might want to look into Sieve of Eratosthenes, as you only have to test up to sqrt(n) for primality: https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes

1 comments

Thank you, AncientPC. I have adjusted the article with the insight you and many others have provided me.