+ 23
[ Challenge :] Print all pair of prime numbers whose sum equals the number given by the user !
(prime number is a number bigger than unity that can be divided with another number resulting modulo 0, only by itself and by unity) e.g. user gives 14, program prints: 3, 11 7, 7 (11, 7, 3 are all numbers that can be divided giving modulo 0 only by themselves or by unity)
59 Respostas
+ 26
//here is my try ... work is in progress ☺
⬜🌹🌹🌹🌹🌹⬜
🌹⬜⬜⬜⬜⬜⬜
🌹⬜⬜⬜⬜⬜⬜
🌹⬜⬜⬜🌹🌹🌹
🌹⬜⬜⬜⬜⬜🌹
🌹⬜⬜⬜⬜⬜🌹
⬜🌹🌹🌹🌹🌹⬜
https://code.sololearn.com/czTIFjtzn23y/?ref=app
+ 9
If I understood correctly with my poor English:
https://code.sololearn.com/coGkC4vJr7sA/?ref=app
+ 9
[challenge]@all pair of prime numbers......
https://code.sololearn.com/c5FYasiEqg44/?ref=app
+ 8
trying
+ 8
up to any number , on C++ :
https://code.sololearn.com/cI9kjnH3AC82/#cpp
( changed after Kartik Krishnan comment. now 1 and its potential Input-1 prime number will not be counted as primes)
+ 6
Thanks for the challenge.
Here's my try :
https://code.sololearn.com/cyCIgLghVey3/?ref=app
+ 5
https://code.sololearn.com/cwwRFceIhiRp/?ref=app
+ 5
@mehmet oh yes... could you give a proof for that!
(to be honest, I am not up to date if somone could up to now. the last exciting news in this direction were about Fermat and 4-color)
+ 4
Only up to 100... but with some brain ... have fun
https://code.sololearn.com/cf2OlIdiu56R/?ref=app
+ 4
Here's my easy solution... :)
https://code.sololearn.com/cm8IzxBkGXSx/?ref=app
+ 4
@Oma Falk No one has proved it for every even number, they are up to 4x10^18 though :D
+ 4
@jonathan 2+17 =19
it it will also work with odds, if the given number is the higher one of prime twins.
+ 4
@Kartik Krishnan
You are right! I fixed my code and changed the explanation of the challenge. Thanks for your comment.
+ 4
TL;DR. One line is enough
https://code.sololearn.com/cFs79ze1k0IY/?ref=app
+ 4
Check out my solution
https://code.sololearn.com/cznBct0MKF02/#
+ 4
Have tried to increase the performance (if is that possible around Python :) )
You may compare on big numbers and give you grades (my modest first try).
also if 4 is the required sum, we still have one pair 2+2 = 4
I saw some of codes just skip this pair
https://code.sololearn.com/ctDXKEfGDH52
+ 4
Here's my C++ approach -
#A precise one...
https://code.sololearn.com/cQyUId6T24WV/?ref=app
+ 4
@Kacper let it run
https://code.sololearn.com/ci6OUOt9oOfV/?ref=app