{{searchResults.length}} {{searchResults.length === 1 ? 'result' : 'results'}} for “{{searchWords}}”No results found for “{{searchWords}}”× back to contents
$n$ fails exactly when every number $n-30j$ with $j\ge1$ and $n-30j\ge1$ is $1$ or prime.
For $n=187$ these are $157,127,97,67,37,7$, all prime, so $187$ fails.
For larger $n$, look at the residue of $n$ mod $30$: in each residue class, a chain of numbers $r,r+30,r+60,\dots$ that are all prime has at most six terms (one of them is divisible by $7$ by the time there are seven), and checking the classes shows that every $n>187$ has a composite $n-30j$.