Find the smallest integer $a$ such that $P = a\cdot1!\cdot2!\cdot3!\cdot4!\cdot5!....\cdot18!$ is a perfect square.
This is a multiple-choice problem for a time-tight exam so I need to be as fast as possible. This is how I did:
Let $Q = 2!\cdot3!\cdot4!\cdot5!....17!\cdot18!$
All primes from $2$ to $18$ are $2, 3, 5, 7, 11, 13, 17.$
The goal is to determine whether the power of each prime is odd or even, and I do this by considering the multiples of each prime in $Q$.
There are $2$ instances of $17$ in $Q$ (from $17!$ and $18!).$ There are no other positive multiple of $17$ that is less than $18$, so the power of $17$ in $Q$ is even, and I can remove $17$ from my consideration. Similarly, I could quickly remove $13, 11.$
There are $12$ instances of $7$ in $Q$ (from $7!, 8!,...,18!$), $5$ instances of $14$ (from $14!, 15!,...,18!$), so we need one more $7$ to make the power even as each $14$ only contains one $7.$
At this point, I also noticed that since $18$ is even, if the multiple under consideration is odd, I have an even number of instances of that multiple, and if even, an odd number of instances (e.g. as shown above, there are $5$ instances of $14$). This helps speed up the evaluation.
Also, I would ignore multiples that contain an even power of the prime under consideration (e.g. $9 = 3^2$), as even while the number of instances is odd, the prime power it carries remains even.
Doing this, I could figure out that only prime $5$ contains an odd power in the remaining primes. So the answer is $a = 5\cdot7 = 35.$
It was the best way I could think of. I'm aware of a method to obtain the power of a certain prime $p$ in number $n!,$ but I couldn't find any better use of it other than to find the power of each prime in almost 18 numbers, which would take a very long time even with the help of a calculator. In the exam, I'm allowed to use a calculator like the one below, so I'd like to hear if there is a faster method to obtain the answer. Thank you! 