factor_trial: Computes the factors of an integer, should they exist, using...

Description Usage Arguments Value References Examples

Description

Integer factorization by trial division is the most inefficient algorithm for decomposing a composite number. Trial division is the method of testing if n is divisible by a smaller number, beginning with 2 and proceeding upwards. This order is used to eliminate the need to test for multiples of 2 and 3. Also, the trial factors never need to go further than the square root of n, √{n}, due to the fact that if n has a factor, there exists a factor f ≤q √{n}.

Usage

1

Arguments

n

Integer to be factored into product of smaller integers.

Value

Vector containing the factors of n should they exist. If n is prime, the returned list will only contain n.

References

Trial division. (2017, April 30). In Wikipedia, The Free Encyclopedia. From https://en.wikipedia.org/w/index.php?title=Trial_division&oldid=778023614

Examples

1
2

aschleg/numberr documentation built on May 14, 2019, 10:31 a.m.