std-primes | ![]() |
Returns the list of prime numbers up to num.
This algorithm is quite expensive. For large numbers it will need some time to calculate the list. The largest list of calculated primes is stored in the global variable *PRIMES* to speed up further calculations.
Sample Timings:
[compiled FAS, P2/233]:
(std-primes 2500): 2.4 sec, (list of 341 numbers)
(std-primes 10000): 19 sec. (list of 1229 numbers)
(std-primes 21)
=> (19 17 13 11 7 5 3 2) (std-primes 50)
=> (47 43 41 37 31 29 23 19 17 13 11 7 5 3 2)
num: Any positive integer number.
A descending list of integer numbers (prime numbers).
Stores a intermediate list of prime numbers in the global symbol *PRIMES*.
(std-require 'PRIMES)
Defined in PRIMES.LSP