2021 isn't a prime number, it's something much worse: it's the product of two prime factors that are as large as they can be, so it takes as long as possible to find out it's not prime. I'm calling this class "fucker numbers"
regret to inform fucker numbers are already in the OEIS under the mundanely informative name "products of two successive primes" https://oeis.org/A006094
@tomharris wait this means 2021 is a fucker number
@t54r4n1 yes!
@tomharris I like fucker number better.
@tomharris "As large as they can be" ??
@Ricardus yeah, imagine you're trying to check if it's prime, so you try dividing by 2, 3, ... etc, and you don't get a prime factor until the last possible prime the smallest prime factor could be (the greatest prime less than the square root)
@tomharris Were you doing this by hand?
@Ricardus in this case, yes. I now have "fucker-numbers.py" for larger ones
@tomharris Huh, neat! What's "as large as they can be"?
@IceWolf basically the smallest of the two prime factors is the largest prime that's less than the number's square root, so if you were primality checking naively by dividing by 2, 3, ..., it would take as long as possible to find a factor
@IceWolf @tomharris All composite numbers must have a prime factor under their square root. The square root of 2021 is 44.9 and the smallest factor (ignoring 1) is 43.
@h @tomharris Wow, that's close!
@tomharris hmm. . . should squares of prime numbers be included in this set?
@h the easiest formalisation says yes, but my instinct says no
@tomharris if not, then this would be any product of adjacent primes
@tomharris old term: RSA encryption. New term: cryptofuckery.
@tomharris sorry if this is an unwelcome question, but would you mind clarifying what makes the prime factors “as large as they can be”?
@Ethancdavenport the smallest prime factor is the largest prime less than the number’s square root. so if you are primarity checking naively it takes as long as possible to find a factor
@tomharris oh wow. That’s a complicated relationship. Thanks for explaining.
@tomharris though there is a class of attacks on RSA if the primes are too close together. For real RSA primes not having the primes on the same order of magnitude is ideal.
the only place for a fucker number is if one comes up as my bib number in a race; I usually try to factor the number as I'm running and oxygen deprived. good if it's not too easy, takes my mind off things