Solomonoff's answer points out that no such DFA exists.
This answer shows that we can build a nondeterministic finite automaton (NFA) that satisfies the requirement, indicating that the original problem might be intended for NFA instead of DFA.
The following nondeterministic finite automaton (NFA) has 7 states whose only accepting state is its start state. The language it accepts is $\{a^{5m+7n}\mid m,n\ge0\}=\{\epsilon,a^5, a^7, a^{10}, a^{12}, a^{14}, a^{15}, a^{17}, a^{19}, a^{20}, a^{21}, a^{22}\}\cup\{a^n\mid n\gt 23\}$. $(23 = 5*7-5-7)$ In other words, it rejects $a^{23}$ and accepts all $a^n$ for $n>23$.
The above image is made using automatonsimulator.com. This answer is motivated by Hendrik Jan's comment.
Interested readers can further prove that 7 is the minimal number of states in an NFA that rejects $a^{23}$ and accepts all $a^n$ for $n>23$.