Split Even Number Into Two Primes - MATLAB Cody - MATLAB Central

Problem 56190. Split Even Number Into Two Primes

Difficulty:Rate
Given an even whole number n (> 2), return a 2-element vector of primes, p, such that p(1) + p(2) = n. The elements of p should be in increasing numerical order (that is, p(1) <= p(2)).
Fun note: technically it cannot be guaranteed that such primes exist for any n. However, although Goldbach's Conjecture has not been formally proven, it has been verified for all n well beyond any you'll face in this problem.

Solution Stats

51.64% Correct | 48.36% Incorrect
Last Solution submitted on Feb 23, 2025

Problem Comments

Solution Comments

Show comments

Group

Are You Smarter Than a MathWorker? Image
Are You Smarter Than a MathWorker?
  • 11 Problems
  • 63 Finishers

Problem Recent Solvers195

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page