6 kyu

Goldbach’s Conjecture

105 of 381Protino

Description:

German mathematician Christian Goldbach (1690-1764) conjectured that every even number greater than 2 can be represented by the sum of two prime numbers. For example, 10 can be represented as 3+7 or 5+5.

Your job is to make the function return a list containing all unique possible representations of n in an increasing order if n is an even integer; if n is odd, return an empty list. Hence, the first addend must always be less than or equal to the second to avoid duplicates.

Constraints : 2 < n < 32000 and n is even

Examples

26  -->  ['3+23', '7+19', '13+13']

100 -->  ['3+97', '11+89', '17+83', '29+71', '41+59', '47+53']

7   -->  [] 
Mathematics
Algorithms

Stats:

CreatedJul 19, 2016
PublishedJul 19, 2016
Warriors Trained804
Total Skips23
Total Code Submissions1339
Total Times Completed381
Python Completions262
Crystal Completions8
Ruby Completions39
JavaScript Completions105
Total Stars14
% of votes with a positive feedback rating91% of 127
Total "Very Satisfied" Votes111
Total "Somewhat Satisfied" Votes10
Total "Not Satisfied" Votes6
Total Rank Assessments10
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Protino Avatar
  • omegahm Avatar
  • GiacomoSorbi Avatar
  • anter69 Avatar
  • metagn Avatar
  • ZED.CWT Avatar
  • saudiGuy Avatar
Ad