Find all n-tuples $(a_1, a_2, ...,a_n)$ of positive integers such that $(a_1 ! – 1)(a_2 ! – 1)... (a_n! – 1) – 16$ is a perfect square. Find all n-tuples $(a_1, a_2,...,a_n)$ of positive integers such that  $(a_1! – 1)(a_2! – 1)... (a_n! – 1)– 16$ is a perfect square.
https://photos.app.goo.gl/b98MVt1MwmTyecLz7
I've done this:
$N=k^2+4^2$ this means that there is not any $p$ prime , $p|N$ , $p=4m−1$ => $a_n!−1≠4m−1$ => $4$ doesn't divide $a_n!$  => $a_n<4$ and also $a_n≠1$ (then $N=0$ which is wrong) $a_n=2,3$ we'll try some combinations of them
$(2!-1)=1$ it doesn't change anything so all we need to do is find solutions for $a_n=3$ but I don't know can I use same $ a_n$ two or more times?

Suppose there are $n$ and $k$ such that $$ (a_1!-1)(a_2!-1)...(a_n!-1)=k^2+16=k^2+4^2\quad (*).$$
Notice that $4$ can not divide the LHS, and consequently $\mathrm{gcd}(k,4)=1$. Then by step $4$ here, every factor of $k^2+4^2$ is a sum of two squares. That is, for all $i=1,\ldots,n$, there are integers $a$ and $b$ such that $$a_i!-1=a^2+b^2.$$
If $a_i\geq 4$, then $a_i!-1\equiv -1\pmod 4$, but $a^2+b^2\not\equiv -1 \pmod 4$. Hence we must have $a_i\leq 3$ for all $i=1,\ldots,n$.
It follows that the LHS in $(*)$ is either zero, which is impossible, or equal to $$(3!-1)^m=5^m$$
for some $0\leq m \leq n$.
Now let's solve $$ k^2+4^2=5^m.$$

*

*If $m$ is even, say $m=2c$, then $k^2+4^2=5^{2c}$ yields $2^4=4^2=(5^c-k)(5^c+k)$. Consequently $5^c-k=2^{u}$ and $5^c+k=2^v$ for some $u,v\geq 0$ with $u+v=4$. This is easy to solve, by just discussing cases.

*If $m$ is odd, say $m=2c+1$, then $k^2+4^2=5\cdot 5^{2c}$ yields $$k^2=((2\omega -1)  5^c-4)((2\omega -1) 5^c+4),$$
where $w=\frac{1+\sqrt{5}}{2}$.

The ring $\mathbb{Z}[\omega]$, which is the ring of integers of $\mathbb{Q}(\sqrt{5})$, is a UFD; see oeis.org/A003172. Moreover $(2\omega -1)  5^c-4$ and $(2\omega -1) 5^c+4$ are coprime (because if $p$ is irreducible and divides $(2\omega -1)  5^c-4$ and $(2\omega -1) 5^c+4$, then $p\bar{p}\mid 8$ and so $p\bar{p}=2\mid k^2$, which is impossible). Hence both factors are squares in $\mathbb{Z}[\omega]$, that is, $$(2\omega -1)  5^c-4=(e+\omega f)^2$$
for some $e,f\in \mathbb{Z}$. But using the fact that $\omega^2= 1+\omega$, we can see that the last equation has no solutions in $e,f\in \mathbb{Z}$.
Consequently all the solutions, if any (as I didn't do the computation), come from the case where $m$ is even.
