# Can 18 consecutive integers be separated into two groups,such that their product is equal?

Can $18$ consecutive positive integers be separated into two groups, such that their product is equal? We cannot leave out any number and neither we can take any number more than once.

My work:
When the smallest number is not $17$ or its multiple, there cannot exist any such arrangement as $17$ is a prime.

When the smallest number is a multiple of $17$ but not of $13$ or $11$, then no such arrangement exists.

But what happens, when the smallest number is a multiple of $17$ and $13$ or $11$ or both?

-
Are we restricted to positive integers? –  abiessu Jan 14 '14 at 22:17
@abiessu.yes actually. –  Hawk Jan 14 '14 at 22:18
@abiessu: In fact it's irrelevant. If all integers are negative, it's the same problem; and if some are positive and some negative, then one of them must be zero, which makes the thing trivially impossible. –  TonyK Jan 15 '14 at 10:38

This is impossible.

At most one of the integers can be divisible by $19$. If there is such an integer, then one group will contain it and the other one will not. The first product is then divisible by $19$ whereas the second is not (since $19$ is prime) --- a contradiction.

So if this possible, the remainders of the numbers after division by $19$ must be precisely $1,2,3,\cdots,18$.

Now let $x$ be the product of the numbers in one of the groups. Then

$x^2 \equiv 18! \equiv -1 \pmod{19}$

by Wilson's Theorem. However $-1$ is not a quadratic residue mod $19$, because the only possible squares mod $19$ are $1,4,9,16,6,17,11,7,5$.

-
@Hawk After the contradiction he checks the case when neither of the numbers is divisible by 19. So if $x$ is the product of all numbers in one group, then $x^2$ is the product of all numbers, becuase note that both groups have the same product(We assumed that). But also we know that the product of all numbers is $18!$ –  Stefan4024 Jan 14 '14 at 22:29
@Hawk The product of all the numbers, and $18!$, leave the same remainder after division by $19$: they are congruent modulo $19$. –  Konstantin Ardakov Jan 14 '14 at 22:31
Can this be generalized to any number of consecutive integers? –  Brilliand Jan 15 '14 at 1:34
@Brilliand No idea if it's true in general, but this method of proof works exactly as well (and the argument is identical) for $p-1$ consecutive integers, where $p \equiv 3 \mod 4$ is a prime. If $p$ is not prime, the argument fails at Wilson's theorem; if $p$ is $1\mod 4$, then the argument fails at quadratic residues ($-1$ is a residue for $p \equiv 1$) –  Mike Miller Jan 15 '14 at 6:34
@Brilliand Yes, it's true for any number of consecutive integers. See the other answer. –  bof Jan 15 '14 at 7:13

If $18$ consecutive positive integers could be separated into two groups with equal products, then the product of all $18$ integers would be a perfect square. However, the product of two or more consecutive positive integers can never be a perfect square, according to a famous theorem of P. Erdős, Note on products of consecutive integers, J. London Math. Soc. 14 (1939), 194-198.

-
In the same way, can we say the product of 4 consecutive numbers cannot be separated in two groups such that their product is equal? Because 5 is prime, only one member will be divisible by 5. –  Fabinout Jan 15 '14 at 9:29
Although note that Erdős doesn't actually prove it for products of fewer than 100 consecutive numbers: he just refers to a paper by Seimatsu Narumi, Tôhoku Math. Journal, 11 (1917), 128-142 which apparently proves cases up to 202 consecutive numbers by special arguments. –  Peter Taylor Jan 15 '14 at 12:17
@Fabinout Maybe none of them is divisible by $5$. Anyway, the Erdős-Narumi theorem applies to any number (greater than $1$ of course) of consecutive numbers. The case of $4$ consecutive numbers is trivial, just observe that $(n^2+3n)^2\lt n(n+1)(n+2)(n+3)\lt(n^2+3n+1)^2$. –  bof Jan 15 '14 at 16:20