I'm not sure how to approach proving solutions for this problem. I wrote a python program which shows a must be $\geq 30$, but I don't understand why.
import math
a=0
while a < 1000:
a = a + 1
Q = ( (math.factorial(a))+6 )**.5
if Q.is_integer():
print("a is ",a," b is ",Q)
But, I don't know how to prove all solutions. How should I approach this problem? Thank you
If $a\geq 6$ then $3\mid a!+6\implies 3\mid b$ so $b=3c$ and thus $9\mid a!+6$ so $3\mid {a!\over 3}+2 $.
Now since $3\mid {a!\over 3}$ we get $3\mid 2$ a contradiction. So $a<6$.
If $a=5$ so $126 =b^2$ a contradiction.
If $a=4$ so $30 =b^2$ a contradiction.
If $a=3$ so $12 =b^2$ a contradiction.
If $a=2$ so $8 =b^2$ a contradiction.
If $a=1$ so $7 =b^2$ a contradiction.
So we have no such pairs.