N is not a square number and consists of 2019 factorial multiplication as shown below:

$N=1!\times 2!\times 3!\cdots 2018!\times2019!$

At least how many factorial needed to be removed from the multiplication to make N a square number?


Theorem: for any natural number $N$, the expression


is a perfect square.

Proof: by induction on $N$. The result is true for $N=1$, since

$(1!)(3!)(4!)=144$ is a square.

Assume the result is true for $N=n-1$. Then we have, for $N=n$,


The extra factor there is


which is a perfect square. Thus the theorem is proved.

So we can remove

four factorials to get a perfect square: namely $2019!,2018!,2017!,1008!$.

Can we do any better?

Since 2017 is prime, we must remove at least one of the top three $2017!,2018!,2019!$ in order to get an even power of 2017 for a perfect square.
In fact, we must remove an odd number of these factors. Same goes for the factors $2011!,2012!,\dots,2019!$ (2011 is also prime), etc.
But, since 1009 is also prime and half of 2018, we must remove an odd number of the factors $1009!,1010!,\dots,2016!,2017!$. Same goes for the factors $997!,998!,\dots,1992!,1993!$ (997 is also prime), etc.

So if we remove just one factor, then it must be

$2017!$. That doesn't give a perfect square, because $(1008!)(2018!)(2019!)$ isn't a perfect square.

If we remove just two factors, then we're going to keep chasing that "must remove at least one of this long list" requirement further and further down the chain of factorials, and we'll end up removing too many.

If we remove just three factors, then they must be

$2017!,2018!,2019!$. Again that doesn't give a perfect square, because $1008!$ isn't a perfect square.

So the final answer is

four factorials must be removed.


Some thoughts

One reason the given product is not a square is that the prime number $2017$ occurs three times: in $2017!$ and $2018!$ and $2019!$

There needs to be an even number of occurrences of any prime, to enable a square root of their product to be possible.

This applies to every prime factor too.
For example when $N = 6$
$1! \times 2! \times 3! \times 4! \times 5! \times 6! = 2^{12} \times 3^5 \times 5^2$
So the product won't be a perfect square because of the odd power of $3$.

Going back to the three $2017$s, either all three or just one of them must be removed.
But if one: which one? I am tempted to make a program which uses a recursive approach

 Find highest prime factor with an odd power
 Explore permutations of factorials removing 1,3,5 etc occurrences as a factor
 For each one, repeat with next lowest odd-powered prime
 If a solution is found, with fewest removals so far, record the series
But it has to be later, if an answer is still needed.


Only factorial that would be perfect Square is 1! Therefore, from 2! To 2019! Have to be removed.

  • 2
    $\begingroup$ Example: $1! \times 3! \times 4! = 6 \times 24 = 144 = 12^2$. $\endgroup$ – Weather Vane Jun 7 '19 at 20:46
  • $\begingroup$ Not my DV, some thoughts in an answer. $\endgroup$ – Weather Vane Jun 7 '19 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.