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!