You might want to check the definition of a prime number. After running your code, @primes includes a lot of numbers that aren't prime (9, 15 and 21 for example). In fact you seem to be calculating all of the odd numbers rather than the prime numbers.
In reply to Re: Easy way to list prime numbers 1 to 100
by davorg
in thread Easy way to list prime numbers 1 to 100
by l.frankline
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |