# If $17! = 355687\underline{ab}8096000$. Then value of $(a,b)$ is

1. If $17! = 355687\underline{ab}8096000$, what is the value of $(a,b)$?

2. If $34! = 295232799\underline{cd}9604140847618609643\underline{ab}0000000$, what is the value of $(a,b,c,d)$?

My Attempt:

We know that

$$17! = 1\times 2 \times 3 \times 4 \times 5\times 6\times 7\times 8 \times 9\times 10 \times 11\times 12\times 13\times 14\times 15\times 16\times 17$$

Thus the RHS must be divisible by $3$,$7$, or $11$.

Step 1: Divisibility by $3$

We know that for some $K\in\mathbb{N}$

\begin{align} K&=\frac{3+5+5+6+8+7+a+b+8+0+9+6+0+0+0}{3}\\ &=\frac{57+a+b}{3}\\ &= 19+\frac{a+b}{3} \end{align}

Therefore, $0\leq a+b\leq 18$, which implies that $(a+b) \in\{0,3,6,9,12,15,18\}$.

Step 2: Divisibility by $11$

We know that for some $L\in\mathbb{N}$

\begin{align} L&=\frac{(3+5+8+a+8+9+0+0)-(5+6+7+b+0+6+0)}{11}\\ &=\frac{9+a-b}{11}\\ \end{align}

This implies that $a-b=2$ or $b-a=9$, and thus we have to solve for $a-b = 2$ and $(a+b) \in\{6,12\}$. Therefore $(a,b) \in\lbrace{(4,2),(7,5)\rbrace}$. Again we have to solve for $b-a=9$ and $b+a\in\{3,9\}$, giving $(a,b)\in\{ (3,6),(0,9)\}$.

So we end up with $(a,b) \in\{(4,2),(7,5),(0,9)\}$. But answer given is $(a,b) = (4,2)$. What did I do wrong?

• Instead of divisibility by 3 you should use divisibility by 9, which works the same way. – vadim123 Oct 10 '13 at 16:17
• $b-a=9$ if an only if $b=9$ and $a=0$. How can you allow $(a,b)=(3,6)$? – Thomas Andrews Oct 10 '13 at 16:19
• – lab bhattacharjee Oct 10 '13 at 16:29
• Another observation: Since $17 > 13$, $17!$ must be divisible by $7\cdot 11\cdot13 = 1001$. Divisibility by $1001$ can be quickly determined, analogously with divisibility by $11$, by alternately adding and subtracting three-digit groups, starting from the last three: i.e., $000-096+ab8-687+355$. That result must be divisible by $1001$ for the whole number to be. We get $355-687-96 = -428$, so $ab8 = 428$. – Brian Tung Aug 21 '15 at 19:23
• The divisibly role of 3 may not help but divisibly role of 9 helps. – Taha Akbari Jun 18 '16 at 5:13

Instead of using divisibility by $3$, use divisibility by $9,$ so that we can actually conclude that $\frac{57+a+b}{9}=6+\frac{3+a+b}9$ is an integer. Since $0\le a+b\le 18,$ then it follows that either $a+b=6$ or $a+b=15$.
As with your work, we can also conclude that $a-b=2$ or $b-a=9$. The latter, though, is impossible, since $b\le 9$ and $a\ge 0,$ so that $b-a=9$ if and only if $b=9$ and $a=0,$ in which case, $a+b\ne 6,15.$ Therefore, we have $a-b=2.$ Since $2a=(a+b)+(a-b)=a+b+2,$ then $2a=8$ or $2a=17,$ but the latter is clearly false, since $a$ is an integer. Thus, $a=4,$ so since $a-b=2,$ then solving the system gives us $(a,b)=(4,2).$
• Rather than the slightly tricky "$a,b$ are either both odd, or both even", why not proceed directly to solving the system: adding $a+b = (6\text{ or }15)$ and $a-b=2$ gives $2a = (8\text{ or }17)$ and so immediately $a=4$. – MJD Oct 10 '13 at 17:37