std-prime-factorization


Synopsis

(std-prime-factorization <num>)

Description

Factorizes the number into all prime multiplicants of descending order.

A prime number always returns a list of a single number.

Examples

(std-prime-factorization 7)    => (7)
(std-prime-factorization 8)    => (2 2 2)
(std-prime-factorization 1118) => (43 13 2)
(std-prime-factorization 1000000) 
=> (5 5 5 5 5 5 2 2 2 2 2 2)

Arguments

num: Any positive integer number.

Return Value

A descending list of positive integer numbers.

Side Effects

Stores a intermediate list of prime numbers in the global symbol *PRIMES* to speed up further calculations and uses the global variable *LASTDIV* stored by a helper function.

Module

(std-require 'PRIMES)

Defined in PRIMES.LSP