factorion | R Documentation |
This function calculates the factorion value for the specified input integer. A number is a 'factorion' if it equals the sum of the factorials of its digits in a given base.
factorion(x, base = 10 , findcycle = FALSE, maxiter = 100)
x |
The integer, or |
base |
The the base of the input integer |
findcycle |
Logical value indicating whether or not to test for cyclic values. See Details for more information. |
maxiter |
A "safety switch" to avoid possible infinite loops, terminating the function prior to convergence. Only applicable when |
Most numbers are neither factorion nor part of a factorion cycle. A cycle occurs if the sequence factorion(factorion(...factorion(x)))
repeats.
A list containing:
x
echoing back the input argument.
isfactorion
value 1 if x
is a factorion and 0 otherwise.
theseq
the sequence of values as each output is fed back to the input.
Carl Witthoft, carl@witthoft.com
https://en.wikipedia.org/wiki/Factorion https://oeis.org/A014080
(factorion(3,base=8,findcycle= TRUE))
# 3 6 1320 12; isit = 0
(factorion(41, base = 6))
# isit = 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.