# Which is the biggest integer that divides all integers that are the product of three consecutive odd numbers?

I read this problem from a high-school-math-problems-calendar, and I'm solving them in my spare time just for the fun of it (what in math is not about the fun? =) ), but this little one it's been hard for me (maybe is a silly problem for mathematicians). Again, this is the problem statement:

Which is the biggest integer that divides all integers that are the product of three consecutive odd numbers?

So far, I did this: $$(m - 1)\cdot(m+1)\cdot(m + 3)\tag{1}$$ where $m = 2k$, expanding: $$m^3+3m^2-m-3=m(m^2-1)+3(m^2-1)$$ (Of course, if I keep simplifying the equation I'll get (1) again). The right term is divisible by $3$, but the left term is divisible by $2$, don't know what else to do... Any ideas?

I know that the answer is $3$ because I made a little program that test the mod $3$ of the product of first $1000$ consequtive odd numbers and it prints $0$ for all of them, but don't know how to prove it

 python -c "for n in xrange(1, 1000, 2): print (n * (n + 2) * (n + 4)) % 3;"


Any help would be appreciated

(I'd appreciate if somebody edit/adds the correct tags for this question)

-
The integer you're looking for must divide the first 1000 products, so if you took the GCD, you can provably limit the possibilities you need to check! – Hurkyl Jul 14 '12 at 0:30
@Hurkyl No, it should not only divide the first $1000$ numbers, I just test it with first $1000$ numbers to confirm that $3$ was the answer – h3nr1x Jul 15 '12 at 5:02

$-3=(-1)\cdot1\cdot3$ is the product of three consecutive odd integers, so any integer that divides all such products must divide $-3$. The divisors of $-3$ are $-1,1,-3$, and $3$, so these are the only candidates. To finish the proof, we need only show that $3$ always does divide the product of three consecutive odd integers.

Let $n$ be any odd integer, and consider the product $m=n(n+2)(n+4)$. There are three possibilities.

• If $n$ is a multiple of $3$, then certainly so is $m$.
• If $n=3k+1$ for some integer $k$, then $n+2=3k+3=3(k+1)$ is a multiple of $3$, and therefore so is $m$.
• If $n=3k+2$ for some integer $k$, then $n+4=3k+6=3(k+2)$ is a multiple of $3$, and therefore so is $m$.

In every case, therefore, $m$ is a multiple of $3$, and $3$ is therefore the largest integer that divides every product of three consecutive odd integers.

-
I’d be interested in learning the reason for the downvote, since the mathematics is correct. – Brian M. Scott Jul 14 '12 at 0:46
I liked this answer the most, because is simple and can be used as an answer for a problem posted in a high-school-math-calendar, also you gave me an idea to work on the problem by myself, thanks – h3nr1x Jul 15 '12 at 5:18

For variety....

If $g$ divides every product of 3 consecutive odd numbers, then

$$g | (m-1)(m+1)(m+3) \qquad \qquad \text{and} \qquad \qquad g | (m+1)(m+3)(m+5)$$

So $g$ is common divisor of these two products. We can do one step of the Euclidean algorithm: subtracting the first from the second says

$$g | (m+1)(m+3) ((m+5) - (m-1)) = (m+1)(m+3) 6$$

and so $g$ divides $6$ times the product of any two consecutive integers. In particular, $g$ also divides $6(m-1)(m+1)$. Repeating this idea, we determine that $g$ divides $24(m+1)$. We could repeat again. Easier to observe $\pm 1$ are the only numbers that divides every odd number, so $g | 24$. Now, only a few numbers to check!

Rather than work 2 at a time, we could take more products and expand them, and do integer Gaussian elimination (no division allowed!) to eliminate the $m$'s, giving us an integer that $g$ must divide.

-
Thanks, I'm giving you a upvote because the answer is right, but, as stated in the question, the problem was extracted from a high-school-math-calendar, so, using the gcd and gaussian elimination is too complex for high-school math – h3nr1x Jul 15 '12 at 5:10

Hint $\rm\ mod\ 3\!:\, n(n\!+\!2)(n\!+\!4) \equiv n(n\!-\!1)(n\!+\!1)\equiv 0.\,$ Prime $\rm\, p\ge5\:\Rightarrow\:p\nmid (p\!+\!2)(p\!+\!4)(p\!+\!6)$

Remark $\$ In fact it is true for any infinite interval of odds, since such an interval must contain some triple $\rm\,np\!+\!2,\,np\!+\!4,\,np\!+\!6,\:$ which has product not divisible by $\rm\,p,\,$ for all $\rm\,p\,$ coprime to $6$.

-