You're breaking up the problem into smaller functions, which is good.
Although it can be taken too far, tighter code is usually preferable. For example:
bool IsOdd(int x)
return (x % 2 != 0);
bool IsPrime(int x)
if(x <= 1) return false; ...
Maybe someone told you that a function should only return from one place. That's nonsense and can lead to verbose code.
To determine if
is prime, do you have to try divisors up to
, or can you stop earlier?
As for where you're stuck,
needs access to all primes less than
. If you build that list, how can you search all combinations of those primes to find one that sums to