I see no one has mentioned Byte-Pair Encoding (BPE) yet.
https://www.gwern.net/GPT-3#bpes
The reason ChatGPT struggles with tasks involving individual character counting is that it can't see individual characters. The word "prime" is a single token (https://beta.openai.com/tokenizer) to the eyes of ChatGPT, and 1 is not prime.