Anonymous user
Sequence of primes by trial division: Difference between revisions
Sequence of primes by trial division (view source)
Revision as of 18:28, 1 December 2015
, 8 years ago→somewhat optimized: used newline instead of break.
m (→somewhat optimized: expanded the vinculum.) |
m (→somewhat optimized: used newline instead of break.) |
||
Line 961:
This is an open-ended approach and it's a simple implementation and could be optimized more with some easy programming.
<br>The method used is to divided all odd numbers by all previous odd primes up to and including the <big>'''√{{overline| }}'''</big> of the odd number.
<lang rexx>/*REXX pgm lists a sequence of primes by testing primality by trial div.*/
parse arg n . /*let user choose how many, maybe*/
|