Factorion

In number theory, a factorion in a given number base $b$ is a natural number that equals the sum of the factorials of its digits. The name factorion was coined by the author Clifford A. Pickover.

Definition

Let $n$ be a natural number. We define the sum of the factorial of the digits of $n$ for base $b>1$ $SFD_{b}:\mathbb {N} \rightarrow \mathbb {N}$ to be the following:

$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 each digit of the number. A natural number $n$ is a $b$ -factorion if it is a fixed point for $SFD_{b}$ , which occurs if $SFD_{b}(n)=n$ . $1$ and $2$ are fixed points for all $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 factorial of the digits is simply the number of digits $k$ in the base 2 representation.

A natural number $n$ is a sociable factorion if it is a periodic point for $SFD_{b}$ , where $SFD_{b}^{k}(n)=n$ for a positive integer $k$ , and forms a cycle of period $k$ . A factorion is a sociable factorion with $k=1$ , and a amicable factorion is a sociable factorion with $k=2$ .

All natural numbers $n$ are preperiodic points for $SFD_{b}$ , regardless of the base. This is because all natural numbers of base $b$ with $k$ digits satisfy $b^{k-1}\leq n\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>SFD_{b}(n)$ until $n . There are a finite number of 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 $SFD_{b}^{i}(n)$ to reach a fixed point is the $SFD_{b}$ function's persistence of $n$ , and undefined if it never reaches a fixed point.

Factorions for $SFD_{b}$ b = (k - 1)!

Let $k$ be a positive integer and the number base $b=(k-1)!$ . Then:

• $n_{1}=kb+1$ is a factorion for $SFD_{b}$ for all $k$ .
• $n_{2}=kb+2$ is a factorion for $SFD_{b}$ for all $k$ .
Factorions
$k$ $b$ $n_{1}$ $n_{2}$ 4 6 41 42
5 24 51 52
6 120 61 62
7 720 71 72

b = k! - k + 1

Let $k$ be a positive integer and the number base $b=k!-k+1$ . Then:

• $n_{1}=b+k$ is a factorion for $SFD_{b}$ for all $k$ .
Factorions
$k$ $b$ $n_{1}$ 3 4 13
4 21 14
5 116 15
6 715 16

Table of factorions and cycles of $SFD_{b}$ All numbers are represented in base $b$ .

Base $b$ Nontrivial factorion ($n\neq 1$ , $n\neq 2$ ) Cycles
2 $\varnothing$ $\varnothing$ 3 $\varnothing$ $\varnothing$ 4 13 3 → 12 → 3
5 144 $\varnothing$ 6 41, 42 $\varnothing$ 7 $\varnothing$ 36 → 2055 → 465 → 2343 → 53 → 240 → 36
8 $\varnothing$ 3 → 6 → 1320 → 12

175 → 12051 → 175

9 62558
10 145, 40585

871 → 45361 → 871

872 → 45362 → 872

Programming example

The example below implements the sum of the factorial of the digits described in the definition above to search for factorions and cycles in Python.

def factorial(x):
total = 1
for i in range(0, x):
total = total * (i + 1)

def SFD(x, b):
total = 0
while x > 0:
total = total + factorial(x % b)
x = x // b