Hello dude. Happy New Year. I want to asking about generating primes algorithm. Can you advice tell me what the fast generating primes algorithm except Sieve of Eratosthenes algorithm? thank you. i want to apply the algorithm to my cryptographic system..
polinolin
0
Newbie Poster
Recommended Answers
Jump to PostHope this helps, can be turned into a function easily.
$startAmount = 0; $endAmount = 100000; for ($i = $startAmount; $i <= $endAmount; $i++) { if($i % 2 != 1) { continue; } $d = 3; $x = sqrt($i); while ($i % $d != 0 && $d …
All 4 Replies
mikulucky
25
Junior Poster in Training
cereal
commented:
great solution
+7
polinolin
0
Newbie Poster
cereal
1,524
Nearly a Senior Poster
Featured Poster
polinolin
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.