Problem 51077. List composite numbers that cannot be written as the sum of two primes

The number 32 is a composite number that can be written as the sum of two primes in two ways: 3+29 and 13+19. The number 33 can be written as the sum of two primes in one way: 2+31. The number 35 cannot be written as the sum of two primes at all.
Write a function to list the composite numbers less than or equal the input that cannot be written as the sum of two primes. Remember that 1 is neither prime nor composite.
Problems that might be related include Cody Problem 60 and Cody Problem 46582.

Solution Stats

50.0% Correct | 50.0% Incorrect
Last Solution submitted on Jul 28, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers12

Suggested Problems

More from this Author309

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!