Twin Primes Program Help

3 Ansichten (letzte 30 Tage)
Brendon
Brendon am 7 Aug. 2014
Beantwortet: Image Analyst am 8 Aug. 2014
I need help writing a program that finds all the twin primes between 10 and 500 without using a built in function.
  5 Kommentare
Geoff Hayes
Geoff Hayes am 8 Aug. 2014
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.
Brendon
Brendon am 8 Aug. 2014
Thanks for your help.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 8 Aug. 2014
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.

Kategorien

Mehr zu Audio Plugin Creation and Hosting finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by