DADiSP Worksheet Functions > Function Categories > Fourier Transforms and Signal Processing > FACTORS

 

FACTORS

Purpose:

Returns the prime factors of a scalar.

Syntax:

FACTORS(ival)

ival

-

An integer, the value to factor.

Returns:

A series.

Example:

factors(357)

 

returns the series: {3, 7, 17}.

Example:

p = factors(1975);

q = cumprod(p);

r = colreduce(p, "*");

s = prod(p);

 

p == {5, 5, 79}

q == {5, 25, 1975}

r == {1975}

s == 1975

Example:

factors(19)

 

returns the series: {19}. 19 is a prime number, so there is only one point in the resulting series.

Remarks:

FACTORS is particularly useful in determining whether a series length is prime. The FFT algorithm runs slowest on series with prime lengths.

 

See PROD to multiply the values of a series and return a scalar.

See Also:

COLREDUCE

CUMPROD

FFT

ISPRIME

LENGTH

PRIMES

PROD