[Math] Summing of factorials to produce perfect cubes

factorialnumber theory

I was playing around with factorials the other day, and I realized that $4!+5!$ is a perfect square. Perplexed by this result, I started looking for other pairs of factorials that produce a perfect square when added together (unbeknownst to me, I had stumbled across a well-known open problem in number theory). I could only find three: $1!+4!$, $1!+5!$, and $1!+7!$. Since $4!+5!$ seemed like an outlier, I decided to focus on the three which satisfy the formula $n!+1=m^2$. I turned to the main Math.SE chatroom, asking if there were any more, which is when I was informed that this is called Brocard's problem. Since it's a well-known open problem, I decided to put my own spin on it. It has probably been done before, but I can't find anything online.

What about the equation $n!+1=m^3$? As far as I know, there is no pair of integers that satisfies this equation. What if the conditions are relaxed? This brings me to the following question I came up with yesterday:

How many perfect cubes can be expressed as the sum of two or more unique integer factorials without subtractions, divisions, or multiplications of factorials?

Notice I said unique, meaning any factorial cannot appear more than once in a sum. With that in mind, I've only found three:$$ \begin{align}&2!+3!=8=2^3\\&1!+2!+4!=27=3^3\;\;\;\Bbb{and}\\&1!+2!+3!+6!=729=9^3\,.\end{align}$$Are there more solutions, or are these the only three?

Using this link, I've concluded any additional solution must have the factorials add up to be greater than $341^3$. Since I hardly have any experience with programming, I can't go much further on this problem… Any and all help would be greatly appreciated.

Note: My question is NOT a duplicate of this one. I'm not restricting my problem to the partial sums $S_n$ of the series $\displaystyle \sum_{k=1}^nk!$.

Best Answer

EDIT: Wrote a command to do sum of distinct factorials by greedy algorithm; here are the perfect powers I have, not allowing $0!$.

jagy@phobeusjunior:~$ ./greedy_factorial
Sat Dec 13 12:25:29 PST 2014
0
1    1
8    3    2
9    3    2    1
25    4    1
27    4    2    1
32    4    3    2
121    5    1
128    5    3    2
144    5    4
729    6    3    2    1
841    6    5    1
5041    7    1
5184    7    5    4
45369    8    7    3    2    1
46225    8    7    6    5    4    1
363609    9    6    3    2    1
403225    9    8    4    1
3674889   10    8    7    6    3    2    1
1401602635449   15   14   13   12   11   10    9    8    7    3    2    1
Sat Dec 13 12:26:23 PST 2014

Did not get any more cubes yet.

jagy@phobeusjunior:~$ ./greedy_factorial
0   square root    0 = 
1   square root    1 =  1 
8 = 2^3
9   square root    3 = 3
25   square root    5 = 5
27 = 3^3
32 = 2^5
121   square root    11 = 11
128 = 2^7
144   square root    12 = 2^2 3
729   square root    27 = 3^3
841   square root    29 = 29
5041   square root    71 = 71
5184   square root    72 = 2^3 3^2
45369   square root    213 = 3 71
46225   square root    215 = 5 43
363609   square root    603 = 3^2 67
403225   square root    635 = 5 127
3674889   square root    1917 = 3^3 71
1401602635449   square root    1183893 = 3 394631

Allowing $0!$ adds in the square $4,$ I'm not sure i see any other change. Not sure why the program is so very slow. As I said, if all you want is cubes, you can program in a greedy algorithm which, for each cube, will rapidly attempt a decomposition as distinct factorials (with repeat 1 for $0!$ if you wish ) and report success.

ALLOWING 0! = 1  ***+++***
jagy@phobeusjunior:~$ ./greedy_factorial
    Sat Dec 13 11:46:03 PST 2014
    0  eleventh root  0
    1  eleventh root  1
    4  square root  2
    8  cube root  2
    9  square root  3
    25  square root  5
    27  cube root  3
    32  fifth root  2
    121  square root  11
    128  seventh root  2
    144  square root  12
    729  cube root  9
    841  square root  29
    5041  square root  71
    5184  square root  72
    45369  square root  213
    46225  square root  215
    363609  square root  603
    403225  square root  635
    3674889  square root  1917
    1401602635449  square root  1183893
    Sat Dec 13 11:46:36 PST 2014
    jagy@phobeusjunior:~$
Related Question