Largest prime number $p$ that cannot be written as the sum of three odd composite numbers? I consider the sequence of composite odd integers: 9, 15, 21, 25, 27, 33, 35, 41, ...
I observe that there are certain large gaps between the composite odd integers and this may contribute towards the solution.
So I start by considering some sums first:
9 + 9 + 9 = 27, 9 + 9 + 15 = 33. So this means that 31 is potentially such a prime number.
Then I consider other sums and manage to obtain 39, 43 and 45. So now 41 becomes the potential contender.
But this method is clearly just trial and error. Is there a more elegant method?
 A: The largest such number is $47$.
Let $C$ be the set of positive odd composite numbers, so $C = \{9,15,21,25, \dots \}$. First check that $47$ can't be written as a sum of three elements of $C$. Now observe that $C$ contains $\{ 6k+3 \mid k \geqslant 1 \}$, so if we can write a prime $p$ as a sum of three elements of $C$, then the same is true of every larger prime $q$ with $p \equiv q \mod 6$. Moreover, every prime $ \geqslant 5$ is congruent to $1$ or $5$ modulo $6$. Finally, the smallest primes greater than $47$ which are congruent to $1$ and $5$ are, respectively, $61$ and $53$, and $53 = 9 + 9 + 35$ and $61 = 9+25+27$ are both sums of three elements of $C$.
A: For every prime $p\gt3$, either $p-25$ or $p-35$ is divisible by $6$.  (Both numbers are even, and $p-25\equiv p-1$ mod $3$ while $p-35\equiv p-2$ mod $3$.). If $p\ge53$, the difference ($p-25$ or $p-35$) is at least $18$, hence can be written in the form $6(a+b+1)=3(2a+1)+3(2b+1)$, with $a,b\ge1$.  Thus every prime $p\gt47$ can be written as the sum of two odd multiples of $3$ and either $25$ or $35$.
Finally, $p=47$ cannot be written as a sum of three composite odd numbers:  If $47=x+y+z$ with $x\le y\le z$ from the list of odd composites, then, since $47/3\lt16$, $x$ must be either $9$ or $15$.  If $x=9$, then $y+z=38$, implying $y$ is also either $9$ or $15$ (since $38/2=19$), neither of which works.  If $x=15$, then $y+z=32$, again implying $y$ is either $9$ or $15$, neither of which works.  (Alternatively, since $25$ and $35$ are the only odd composites less than $47$ that are not multiples of $3$, and since $25+25\gt47$, we would have to write $47=x+y+35$.  But $x+y=12$ has no solutions in odd composites.)
