Twin Primes Program Help
3 次查看(过去 30 天)
显示 更早的评论
I need help writing a program that finds all the twin primes between 10 and 500 without using a built in function.
5 个评论
Geoff Hayes
2014-8-8
Brendon - suppose you had a set of all numbers from 10 through to 500. Given the definition of a prime number, which of those numbers in this set can you (easily) eliminate first?
The even numbers or all those that are a multiple of two. What numbers could you try to eliminate next? Etc.
回答(1 个)
Image Analyst
2014-8-8
Take a look at http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes. I'm sure someone must have coded this up in MATLAB and probably uploaded it to the File Exchange.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio Plugin Creation and Hosting 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!