PRIME NUMBERS LIST#callange# | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

PRIME NUMBERS LIST#callange#

Hi there! just for the fun of it ,write a code to print out the list of all prime numbers less than a certain value! Lets see who will go highest!! Happy Coding https://code.sololearn.com/cHgt6aag99I8/?ref=app

13th Jan 2018, 8:43 AM
Hamid
Hamid - avatar
15 Answers
+ 8
check this java version i think you like!! https://code.sololearn.com/c8KCZTNWXzC8/?ref=app
15th Feb 2018, 6:46 PM
ASIF BILAKHIYA
ASIF BILAKHIYA - avatar
+ 3
i win. works up to n<11220046696331 https://code.sololearn.com/cQq22e5PF7wY/?ref=app
13th Jan 2018, 11:26 AM
VcC
VcC - avatar
+ 3
Thaks for your effort. Be Well and Happy Coding
20th Jan 2018, 3:06 PM
Hamid
Hamid - avatar
+ 2
I could go upto primes less than 14500 when the stars were perfectly alighned and the wind and tide were favourable! :- ) 15000 with the help of some luck. Solo learn IDE is the bench mark!
13th Jan 2018, 8:46 AM
Hamid
Hamid - avatar
+ 2
I tried to make it twice as fast.I could only once get upto 20,000 .And 25,000 when the connection was good. https://code.sololearn.com/ct5H3HqzBxht/?ref=app
13th Jan 2018, 10:01 AM
Hamid
Hamid - avatar
+ 2
It is noteworthy that when square root is introduced into the code as below ; Code will give time limit around 5500 whereas the code (2) would go upto 20000. I just hope that sololearn IDE works independent of internet speed and I have not waisted everybodies time. Happy Coding https://code.sololearn.com/cBLj66I3xJAp/?ref=app
21st Jan 2018, 5:30 AM
Hamid
Hamid - avatar
+ 1
https://code.sololearn.com/c8tfg3EUscNT/?ref=app
13th Jan 2018, 3:53 PM
...
+ 1
My executes different theory of prime numbers, not as fast as you guys though... https://code.sololearn.com/cSDpaE2zNtjZ/#py
13th Jan 2018, 10:55 PM
Lindsay Linjie Chen
Lindsay Linjie Chen - avatar
+ 1
https://code.sololearn.com/cX3s5Z60JFhS/?ref=app
19th Jan 2018, 8:05 PM
Вадим Сухотин (Vadim Sukhotin)
Вадим Сухотин (Vadim Sukhotin) - avatar
+ 1
https://code.sololearn.com/cGQRSBHN2UPH/?ref=app
20th Jan 2018, 9:48 AM
Вадим Сухотин (Vadim Sukhotin)
Вадим Сухотин (Vadim Sukhotin) - avatar
0
2^77217932-1. if you find bigger you win 150.000 $
13th Jan 2018, 7:47 PM
VcC
VcC - avatar
0
All prime numbers in interval. Input begin and end of interval. https://code.sololearn.com/cMC3JLRv0T04/?ref=app
19th Jan 2018, 9:59 PM
Вадим Сухотин (Vadim Sukhotin)
Вадим Сухотин (Vadim Sukhotin) - avatar
0
https://code.sololearn.com/cJc7ZrQFexKa/?ref=app Updated.
20th Jan 2018, 3:12 PM
Вадим Сухотин (Vadim Sukhotin)
Вадим Сухотин (Vadim Sukhotin) - avatar
0
Very strange, but this code runs a little faster than my previous one. The previous code produced numbers up to 13000, and this one up to 13500. Although here I did not apply almost any optimization, divided into odd ones. And in previous code, I only divided into the already found prime numbers. It is possible that the overhead of organizing an array of found prime numbers exceeded the savings from a reduction in the number of divisions. https://code.sololearn.com/cBF6i9cbOh3c/?ref=app
20th Jan 2018, 9:58 PM
Вадим Сухотин (Vadim Sukhotin)
Вадим Сухотин (Vadim Sukhotin) - avatar