An exercise in Burton's book "Elementary Number Theory" 7ed, p43 prob 2, is to give a counterexample to the statement:
Every positive integer $n$ has a representation $n=p+a^2$, where $p$ is $1$ or a prime, and $a\ge 0$ is a nonnegative integer.
This is false for $n=25$. I'm interested in finding all $n,$ or maybe some infinite families of $n$, for which it is false.
By looking at factors of a difference of squares, I found the family $n=m^2$, where $2m-1$ is composite. $25$ is in this family.
When $n$ is square the ability to factor makes the problem simple; so I'm looking for larger sets of counterexamples. I'd be surprised if one could characterize all $n$ which are counterexamples, but would want to use whatever result is found to actually generate the appropriate counterexamples.
No infinite family except squares is known. In fact, only $21$ numbers are known that are not a square nor a prime plus a square, see OEIS/A020495:
$ 10,34,58,85,91,130,214,226,370,526,706,730,771,1255,1351,1414,1906,2986,3676,9634,21679 $
Apparently, these are all the examples up to $3000000000$.