PFD | R Documentation |
PFD
converts a positive integer to its prime-factor decomposition or *vice versa*
PFD(x) ## S3 method for class 'prime.factor.decomposition' print(x, quote = FALSE, ...)
x |
An input vector/matrix/array (can be a vector of integers/bigz or PFDs) |
quote |
logical, indicating whether or not strings should be printed with surrounding quotes. |
... |
further arguments passed to or from other methods. |
This function converts a vector of integers to a corresponding character vector giving the prime-factor decomposition in a condensed form. The input can be a vector of integers or a 'bigz' vector containing large integers. In either case the function returns the corresponding vector of the prime-factor decomposition (PFD) values, written in a condensed character form. The function also converts back from the PFD form to an integer/bigz vector.
This function depends on the gmp package.
If the input is integer/bigz then the output is the PFD; if the input is PFD then the output is integer/bigz
PFD(1:10) stopifnot(all.equal(1:100, PFD(PFD(1:100))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.