Elektrine lite

← Feed

@arichtman@eigenmagic.net

Post #3954141

2026-07-20 07:55 UTC

Math fedi, help! I'm looking for a function that calculates the next prime given a starting integer (not guaranteed prime) - i.e. what's the smallest prime larger than this number. It looks like there are some functions for generating primes but nothing with a minimum and all the other articles are basically "loop and test each one" - maybe using a sieve function. Does a nicer mathematic approach exist? #Math #Mathematics #PrimeNumbers #Primes

Replies (2)