The sieve for prime numbers
Write the numbers 1 to 50 and cross out multiples until only the primes are left, then find out where to stop.
- إيران: الصف ٨
لم يُترجَم هذا المختبر إلى هذه اللغة بعد.
الدليل
This studio follows the Iranian Grade 8 lesson on finding primes. A عدد أولي has exactly two factors, 1 and itself. 1 is not prime because it has only one factor.
The sieve: write 1 to 50. Put 1 aside. Cross out the multiples of 2 (but not 2 itself), then of 3, then of 5 and then of 7. The numbers not crossed out are prime.
To test one number you do not need every smaller number. It is enough to try the primes whose square is not bigger than the number.
If no such prime divides the number, it is عدد أولي; otherwise it is عدد غير أولي.