All positive integers a and b such that $a! + 6 = b^2$

85 Views Asked by At

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

4

There are 4 best solutions below

1
On

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.

0
On

for an integer $a$, $a!$ is also an integer. let $A=a!$, so: $$A+6=b^2$$ now we know that $A\ge1$ due to the limitations of the factorial function for integer values. By running through values of $A$ you can find $b$, now work back and go through a list of $n!$ and $A$ to see which is equal. This seems like the easiest way

0
On

If $a \ge 7$ then $7|a!$ and $b^2 =a! + 6 \equiv -1 \pmod 7$.

But $b^2 \equiv -1\pmod {odd\ prime}$ has no solution.

So if there is any solution $a < 7$.

We can just check them one after another.

$1+6=7;2+6=8; 6+6=12;24+6=30; 120+6=126; 720+6 = 726$ and none of those are square.

(For what it's worth I didn't come up with testing for $7$ right away. I first figured that if $a \ge 6$ [actually $a\ge 3$] then $6|a!+6$ and so $6|b$. Then for all $k \le a$ that $b^2 \equiv 6 \pmod k$ and then $b^2 \equiv 1 \pmod 5$ and $b^2 \equiv -1 \pmod 7$ seemed fruitful....)

0
On

If $a\ge 4$ then $4\mid {a!}$ $\implies$ $$b^{2}\equiv 6\pmod4$$ $\implies$ $$b^{2}\equiv 2\pmod4$$ This is impossible. So there are no pairs $(a,b)$ satisfying this equation.