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
Similar Kata:
Stats:
Created | Jul 19, 2016 |
Published | Jul 19, 2016 |
Warriors Trained | 804 |
Total Skips | 23 |
Total Code Submissions | 1339 |
Total Times Completed | 381 |
Python Completions | 262 |
Crystal Completions | 8 |
Ruby Completions | 39 |
JavaScript Completions | 105 |
Total Stars | 14 |
% of votes with a positive feedback rating | 91% of 127 |
Total "Very Satisfied" Votes | 111 |
Total "Somewhat Satisfied" Votes | 10 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |