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

48.28% Correct | 51.72% Incorrect
Last Solution submitted on Nov 20, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers10

Suggested Problems

More from this Author244

Community Treasure Hunt

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

Start Hunting!