# Is it too late for April Fools?

Algebra Level 5

Let $\mathbb{N}$ be the set of nonnegative integers. Define a function $f : \mathbb{N}^3 \to \mathbb{N}$ satisfying the following for any $a,b,c \in \mathbb{N} \setminus \{0\}$:

$\begin{cases} f(0,0,0) &= 2015 \\ f(a,0,0) &= f(a-1,1,0) \\ f(0,b,0) &= f(0,b-1,1) \\ f(0,0,c) &= f(c-1,0,0) \\ f(a,b,0) &= f(a-1,b-1,2) \\ f(a,0,c) &= f(c-1,1,a-1) \\ f(0,b,c) &= f(0,b-1,c+1) \\ f(a,b,c) &= f(b,c,a-1) \\ \end{cases}$

A happinization of a positive integer $n$ is an infinite sequence of integers, where the first term of the sequence is $n$, and every term afterwards is the sum of the squares of the digits of the previous term. For example, the happinization of $2015$ is $2015, 30, 9, 81, 65, 61, 37, 58, 89, 145, 20, 4, 16, 37, \ldots$. A happy number is a positive integer whose happinization ends with an infinite number of $1$s; all other positive integers are sad numbers. For example, $2015$ above is sad, but $1$ (with happinization $1, 1, 1, 1, \ldots$) is happy.

For any positive integer $n$, define $p_n$ as the product of the first $n!$ happy numbers. Let $A = p_1, F = p_2, I = p_3, L = p_4, O = p_5, P = p_6, R = p_7, S = p_8$. Compute the value of $f(APRIL,FOOLS,2015)$.

×