Prime Factorization – Find Prime Factor of ?_{j=1}^{10} j!^{j!}

elementary-number-theoryfactorialprime factorizationrecreational-mathematics

What is the smallest prime factor of $$\sum_{j=1}^{10} j!^{j!}$$ ?

  • Trial :

This number has $23\ 804\ 069$ digits , so if it were prime it would be a record prime. I do not think however that this number is prime. According to my calculations , it has no prime factor below $10^{10}$. To establish its compositeness I search the smallest prime factor.

  • Motivation

The fast growing function $$f(n):=\sum_{j=1}^n j!^{j!}$$ cannot be a prime number for any positive integer $n$ except from $n=2$ (which gives a very small prime) and $n=10$ (which might give a prime). The reason is that $13\mid f(n)$ holds for every integer $n\ge 12$ and for the other cases , prime factors can easily be found. This makes this case interesting since it completes the primality search.

Best Answer

$2198910029959$ is a prime factor (that's about $2 \times 10^{12}$). I'm about $90\%$ sure it's the smallest one - the other $10\%$ is if there's a bug in my code or I accidentally forgot to check some of the smaller primes.

You can find my code here. I'm sure it could have been written to be faster/better or there's a better language to do it in :). I observed that the integers are all about the right size that we can get away with using $64$- and occasionally $128$-bit arithmetic and I just thought it would be fun to write a C program to search for factors. It checks about $1.5 \times 10^{6}$ primes per second on my laptop, and I searched several ranges in parallel overnight.

I checked a number of its calculations against a more naïvely written Python program, as well as the final prime factor it produces, and that all checked out.

Related Question