Let n be a natural number. For a base b > 1, we define the
sum of the factorials of the digits of n, \operatorname{SFD}_b : \mathbb{N} \rightarrow \mathbb{N}, to be the following: :\operatorname{SFD}_b(n) = \sum_{i=0}^{k - 1} d_i!. where k = \lfloor \log_b n \rfloor + 1 is the number of digits in the number in base b, n! is the
factorial of n and :d_i = \frac{n \bmod{b^{i+1}} - n \bmod{b^{i}}}{b^{i}} is the value of the ith digit of the number. A natural number n is a b-
factorion if it is a
fixed point for \operatorname{SFD}_b, i.e. if \operatorname{SFD}_b(n) = n. 1 and 2 are fixed points for all bases b, and thus are
trivial factorions for all b, and all other factorions are
nontrivial factorions. For example, the number 145 in base b = 10 is a factorion because 145 = 1! + 4! + 5!. For b = 2, the sum of the factorials of the digits is simply the number of digits k in the base 2 representation since 0! = 1! = 1. A natural number n is a
sociable factorion if it is a
periodic point for \operatorname{SFD}_b, where \operatorname{SFD}_b^c(n) = n for a positive
integer c, and forms a
cycle of period c. A factorion is a sociable factorion with c = 1, and a
amicable factorion is a sociable factorion with c = 2. All natural numbers n are
preperiodic points for \operatorname{SFD}_b, regardless of the base. This is because all natural numbers of base b with k digits satisfy b^{k-1} \leq n . Given that each of the k digits is at most b-1, \operatorname{SFD}_b \leq (b-1)!k. However, when k \geq b, then b^{k-1} > (b-1)!(k) for b > 2, so any n will satisfy n > \operatorname{SFD}_b(n) until n . There are finitely many natural numbers less than b^b, so the number is guaranteed to reach a periodic point or a fixed point less than b^b, making it a preperiodic point. For b = 2, the number of digits k \leq n for any number, once again, making it a preperiodic point. This means also that there are a finite number of factorions and
cycles for any given base b. The number of iterations i needed for \operatorname{SFD}_b^i(n) to reach a fixed point is the \operatorname{SFD}_b function's
persistence of n, and undefined if it never reaches a fixed point. ==Factorions for ==