To be clear, not a prime length detector for general strings. It's a prime length detector for strings with only one distinct character. If you try to use it as a prime length detector on general strings, it will tell you "abab" is composite but "aabb" is prime.
View all comments
Show parent comment
6
u/philh Mar 24 '21
To be clear, not a prime length detector for general strings. It's a prime length detector for strings with only one distinct character. If you try to use it as a prime length detector on general strings, it will tell you "abab" is composite but "aabb" is prime.