Adding function for prime character repeated

Added function to check the pattern of a character repeated a prime
number of times