Is the set of prime numbers a regular language?

1.1k Views Asked by At

I know that the language of prime numbers written in unary is not a regular language, but what about the prime numbers themselves? (When the alphabet is 0~9) By intuition, I think it's not a regular language, but how to prove it?

1

There are 1 best solutions below

1
On BEST ANSWER

The generating function of the number of words of a given length in a regular language is a rational function. This constrains the growth rate of these numbers. By the Prime Number Theorem, the number of primes of a given length (whether or not we admit leading zeroes) does not grow at a rate compatible with the generating function being rational.