Mersenne primes, polygonal anomalies and string theory classification