# Minimize $a+b+c$ where $a!=b! \cdot c^2$ and $c \geq 10$, $a,b,c \in \Bbb N^+$

For $c=10$, we get $a=100$ and $b=99$.

However, I am wondering if it is possible to write a square of a number as a multiplication of consecutive integers. So, if

$c^2 = a (a-1) (a-2) \cdots (a-n)$

then we would possibly get a smaller $a+b+c$.

$b=1$, $\ \$ ($n=a-1$) is not possible because the only square factorials are $0!$ and $1!$.

These are my thoughts on the problem. Thanks for your help.

Comment turned into answer per request.

The product of consecutive positive integers is never a perfect square. First proved by Paul Erdős in 1939. An online copy of that paper Notes on products of consecutive integers can be found here.

• After a peek at the paper by Erdos it seems this is not an easy theorem. – DanielWainfleet Oct 22 '17 at 20:29

If you wanted to show this without using the Erdős theorem, you could proceed something like:

1. The value $a+b+c$ is 209, using $a=100,b=99,c=10$. To obtain a smaller value for $a+b+c$, then $c < 209$.
2. $208^2=43264$, so $c$ would have to be the product, $p$, of a set of consecutive integers, where $p \leq 43264$.
3. The longest sequence of positive integers where $p \leq 43264$ is $1\dots 8$. The second longest is $2\dots8$. Neither are squares.
4. The third longest (length$=6$) are $2\dots7$ and $3\dots8$. Not squares.
5. The fourth longest (length$=5$) are $2\dots6,\dots, 4\dots8,\dots, 6\dots10$. None are squares.
6. The fifth longest (length$=4$) are $2\dots5,\dots, 8\dots11, \dots, 12\dots15$. None are squares.
7. The seventh longest (length$=3$) are $2\dots4, \dots, 14\dots16, \dots, 34\dots36$. None is a square.
8. The seventh longest (length$=2$) are the pairs: $2\dots3, \dots, 36\dots37, \dots, 207\dots208$. The product of no pair of consecutive integers is a square.
9. The shortest sequences are single numbers. However the minimum solution with a single number is $a=100,b=99,c=10$.
10. Therefore you know the solution is $b=99$.

There are $1+2+5+11+33+206=258$ cases to check using this method.

You can eliminate the cases of 3 consecutive integers by observing the following (where the minimum number in all sequences is at least 2):

1. Assume none of the 3 is a square. If the smallest of the 3 integers is odd, then all 3 integers are coprime, hence the product has at least 3 prime factors with odd exponents and isn't a square
2. Assume none of the 3 is a square. If the smallest of the 3 integers is even, it and the last integer have 2 as common factor, but no other shared prime factors. The first integer divided by 2 may be a square, or the third divided by 2 may be a square, but not both. Therefore at least one of the two has a prime factorization where at least one odd prime factor has an odd exponent. Since, besides a factor of 2, the three are all coprime the product will have at least 2 odd prime factors with odd exponents, hence not a perfect squares.
3. Assume one of the 3 is a square. The other two won't be squares. There are two cases: square is middle number, square is not middle number. If square is middle number the product of the other two is of the form $n^2+2n$, else $n^2+n$. Neither expression can be a square.

Although I haven't attempted it, I'm confident you could employ similar reasoning to prove that the products of sequences with lengths of 4, 5, 6, and 7 can't be square, but I'd guess the proofs might be more complicated.

This is a variant of Xpw's answer, intended to reduce the number of separate cases that need to be examined in order to show that $(a,b,c)=(100,99,10)$ minimizes the sum $a+b+c$ if $c\ge10$.

Suppose $a!=b!\cdot c^2$ with $c\ge10$ and $a+b+c\lt209$. Let's write $a=b+n$. Then we have

$$c^2=(b+1)(b+2)\cdots(b+n)\le(208-2b-n)^2$$

We cannot have $n=2$, since any two consecutive integers are relatively prime, hence each would have to be a square in order for their product to be a square, but positive squares differ by at least $3$.

For $n\ge3$ we have the following crude inequality:

$$b^n\le205^2\lt50000$$

(You can be less crude if you like, but there's little to be gained from it.) Since $40^3=64000$ and $20^4=160000$, we see that $b\lt40$ if $n=3$ and $b\lt20$ if $n\ge4$. Let's do the $n\ge4$ case first.

Any string of $4$ or more consecutive numbers starting at a number less than or equal to $20$ contains at least one prime within the final $4$ numbers in the string (the first prime gap greater than $4$ occurs at $29-23$). The product of such a string contains that prime to the first power only, hence cannot be a square.

Any string of three consecutive numbers contains exactly one number divisible by $3$. In order for their product to be a square, the number divisible by $3$ must be divisible by an even power of $3$. For strings beginning at $40$ or less, the only possibilities are $9$, $18$, and $36$. Since $7$, $11$, $17$, $19$, and $37$ are primes, the only strings to check are $8\cdot9\cdot10$ and $34\cdot35\cdot36$, neither of which is a square.