prime_factors: Perform Prime Factorization on a Vector

View source: R/RcppExports.R

prime_factorsR Documentation

Perform Prime Factorization on a Vector

Description

Compute the prime factors of elements of an integer vector.

Usage

prime_factors(x)

Arguments

x

an integer vector.

Value

A list of integer vectors reflecting the prime factorizations of each element of the input vector.

Author(s)

Paul Egeler, MS

Examples

prime_factors(c(1, 5:7, 99))
## [[1]]
## integer(0)
##
## [[2]]
## [1] 5
##
## [[3]]
## [1] 2 3
##
## [[4]]
## [1] 7
##
## [[5]]
## [1]  3  3 11


Ironholds/primes documentation built on Feb. 1, 2024, 1:26 a.m.