2

I was asked in a contest to determine if $3267936$ is divisible by $1621$ in $15$ seconds.

How can I know in $15$ seconds if $3267936$ is divisible by $1621$ without using long division, and what is divisibility rule of $1621$?

Blue
  • 83,939
  • 2
    $3267936$ is divisible by $3$ (sum of digits is divisible by $3)$ and $1621$ is not divisible by $3$ (sum of digits is not divisible by $3).$ Maybe there are other methods, but this was the 2nd thing I tried. The 1st thing I tried was to consider units digits, but the units digit of $3267936,$ which is $6,$ is the units digit of some multiples of $1621$ -- note that $1621$ times any positive integer with units digit $6$ has a product whose units digit is $6,$ so we can't use this reasoning to exclude $3267936$ being a multiple of $1621.$ – Dave L. Renfro Jan 08 '23 at 09:56
  • Is there a reason not to use long division? I would be surprised if there is a quick general divisibility test for $1621$. – paw88789 Jan 08 '23 at 10:04
  • 10
    @DaveL.Renfro Simply because 3267936 is divisible by 3 and 1621 is not divisible by 3 does not imply anything about the divisibility of 3267936 by 1621. – Chris Christopherson Jan 08 '23 at 10:07
  • 3
    @DaveL.Renfro How would that help? If $3 \mid m$ and $3 \not \mid n$, that doesn't say anything about whether $m$ is divisible by $n$ or not. – VTand Jan 08 '23 at 10:07
  • Yikes! I guess I shouldn't be doing push-up sets in-between commenting here. (I'm leaving for the gym -- elliptical trainer workout -- soon, and this is part of my warm-up.) I'll delete my comments soon, to save some face and to decrease the clutter here . . . (moments later) Maybe I'll leave my first comment, since it might help others to know what WON'T work here. – Dave L. Renfro Jan 08 '23 at 10:09
  • 5
    Further, if I attended this contest in the year 2016 and was aware of trends and taboos in math contests i would think to myself, "Pssh, its probably one of those tricks where we have $1621\cdot 2016 =3267936$ but just to check if thats even close: $$1621\cdot 2016\approx 1600\cdot 2000 =3200000 \approx \approx \approx 3267936$$ meh, close enough. YES! It's divisible." (Roughly 8 seconds) :) – Chris Christopherson Jan 08 '23 at 10:24
  • There doesn't need to be any divisibility rule. Honestly, this took me just 20 second (take my word for it), but : a little bit of familiarity with playing around with numbers in your childhood leads you to numbers with a fairly large number of factors, the likes of $24$, $48$ etc. It took me about $1.5$ seconds to recall that $21 \times 16 = 336$ so I can get rid of the last two digits. Then it so happened that $1621 \times 16$ was done in approx. $10$ seconds, and left me with $3242000$ from where the answer is obvious in $2$ seconds. It is not so difficult. – Sarvesh Ravichandran Iyer Jan 08 '23 at 10:26
  • 1
    @ChrisChristopherson at the end maybe we rely on human behaviour, may the fact that humans like to have large numbers completely divisible or else it looks bad .... haha – Dstarred Jan 08 '23 at 10:26
  • Actually, hang on : a little known Sutra in Vedic math will tell you whether the divisibility holds or not. I'm not able to find the link to the Sutra, but I do remember it. It takes about 40 seconds for me to get through this one, though. – Sarvesh Ravichandran Iyer Jan 08 '23 at 10:30
  • 6
    I think the answer is: no, $15$ seconds is not long enough. – Adam Rubinson Jan 08 '23 at 10:32
  • 2
    It can be done in $\rm 15:!s$ by the universal divisibility test - i.e. modular long division ignoring quotients, e.g. subtracting from $\color{#c00}{326}7936$ the first quotient $\lfloor \color{#c00}{326}/16\rfloor = 20$ times $162100$ we reduce to testing $\color{#0a0}{259}36$, then subtracting $\lfloor \color{#0a0}{259}/16\rfloor = 16,$ times $1621$ we reduce to testing $0$, and clearly $,0,$ is divisible by $2016.,$ Everything above is very easy & quick mental arithmetic. – Bill Dubuque Jan 08 '23 at 13:38
  • For much more on general divisibility tests and related ideas see here and its links. – Bill Dubuque Jan 08 '23 at 13:40
  • You still have to multiply 16x1621, then 2x1621 then do some subtractions. Check my answer where you have only 3 multiplications 4x1 and additions, plus 4 deductions. Everything solves in one pass. – WindSoul Jan 08 '23 at 18:01
  • @Wind No, I used the following $< 3$ seconds mental arithmetic $,\color{#c00}{259}36!-!\color{darkorange}{16}(\color{#c00}{16}\color{#0a0}{21}) = \color{#c00}336!-!\color{darkorange}{16}(\color{#0a0}{21})!=!0.,$
    The problem with other ad-hoc methods is that most of them take (much) more time to discover (let alone execute), and they rarely generalize.
    – Bill Dubuque Jan 08 '23 at 18:49
  • @BD, The method is fast. However maths I remember from school I’ve learned about this yet when it came to answer the question I would reconstruct the quotient using one digit from the dividend one step at a time. – WindSoul Jan 08 '23 at 19:52
  • @Wind In divisibility tests we care only about the remainder (not the quotient) so we can subtract any convenient multiple of the divisor (since $,d\mid n\iff d\mid n - kd),,$ e.g. see here where it proves convenient to use larger-than-normal multiples that yield negative digits (i.e. we use a balanced "signed" residue system). – Bill Dubuque Jan 09 '23 at 03:40
  • 1
    I agree Adam Rubinson. This exercise is pointless. – Peter Jan 09 '23 at 08:27
  • I understand that the quotient could be negative as long as it multiplies the divisor-rendering it a factor of the dividend. Alina’s answer follows without going into negative remainders. My method is different in that I’m shooting at dividend one digit at a time by reconstructing the quotient in just a different manner of doing division without actually doing any division. If we taught the kids in school to do division this way we won’t have them through the anguish of learning another operation once they already knew addition and multiplication which is anything they needed to learn anyway. – WindSoul Jan 09 '23 at 14:25
  • @Wind It seems you misunderstood. It's remainders (not quotients) that we may allow negative if convenient. The point is that testing if $d$ divides $n$ is equivalent to testing if $d$ divides $n-kd$ for any integer $k$ and we are free to choose $k$ in any way that ends up simplifying the calculations. In the linked posts this is being applied to (leading) chunks of digits in radix notation. – Bill Dubuque Jan 09 '23 at 14:36
  • Thank you for the extra detailing. Made a mistake, meant remainder. – WindSoul Jan 09 '23 at 15:28
  • How many digits do you need to write down to get the answer? Less than 19? – WindSoul Jan 10 '23 at 19:19

5 Answers5

2

Write the numbers below each other this way:

 3267936  
 1621

Fill the smaller number with zeroes

 3267936  
 1621000

Subtract it from the bigger number

 3267936  
-1621000
--------
 1646936

Replace the larger of the two original numbers ($3267936$) with this result and repeat this process so that you now start with ($1646936$) and ($1621$).

 1646936  
 1621

1646936
1621000

1646936

-1621000

25936

Again replace the bigger number ($1646936$) with the result.

 25936  
 1621

25936
16210

25936

-16210

9726

Replace again. No more zeroes need to be added.

 9726  
-1621
-----
 8105

and so on

 8105
-1621
-----
 6484

You again replace the bigger number with the result. I now add gaps between the digits because this makes my explanation easier. When you are in the process, you just have to try to find these gaps in your mind

 64 8 4
 16 2 1

At this point you will notice that $64 = 16\cdot4$ and $8 = 2\cdot4$ and $4 = 1\cdot4$. So you have a number in each column in the second row and a multiple of 4 of that number above it. And that means that $6484 = 1621\cdot4$. In other words, $6484$ is divisible by $1621$. And since we only subtracted multiples of $1621$ in every single step, $3267936$ must also be divisible by $1621$.

If you are familiar with this technique, you can do this in less than 15 seconds, and if you practice it hard, you can even do it in your head without using pen and paper.

If you do it on paper, you don't need to write down numbers you already have written and you can add the filling zeros just in your head. You will be even faster, if you start with the two numbers side by side. Longer sequences of digits that are the same as in the line above don't need to be written (I marked these placed here with dots, but in practice you don't write them). Then at the end your notes will look like this:

3267936  1621
1646...
  25...
   9726
   6484

By the way, the algorithm used here is the Euclidean algorithm. This is a 2300 year old, very fast algorithm for finding the common divisor of two numbers. If the common divisor of two numbers is the smaller of the two, then the larger number is divisible by the smaller one.

Alina
  • 182
  • 5
  • This isn't the Euclidean algorithm. I think it's more like, long division with some longer-than-necessary parts, but with some shortcuts along the way also. The Eucliden algorithm does, for example, $(1071,462)\to (462,147) \to (147,21) \to (21,7),\ \implies \gcd(1071,472) = 7.$ – Adam Rubinson Jan 08 '23 at 10:55
  • 1
    @AdamRubinson: Alina's algorithm is almost exactly the Euclidian algorithm as shown in the pseudocode in the German Wikipedia article. This version of the algorithm uses only comparisons and subtractions while the version you find in many textbooks also needs multiplications, but multiplications need more time to execute than subtractions. Alina used a mixture of both, but is still is a version of Euclidian algorithm. – Hubert Schölnast Jan 08 '23 at 11:17
  • This is essentially an (unoptimized) application of the universal divisibility test – Bill Dubuque Jan 08 '23 at 13:46
  • You need to write down 38 digits before getting the answer. Is that the fastest method? – WindSoul Jan 10 '23 at 19:21
  • @WindSoul: What did you count? Look at the last code block of my answer and count the digits. There are just 25 digits in 5 rows. The 11 digits in row 1 are from the original numbers, so only 14 new digits have to be written. And only 4 subtractions have to be done. And no division at all. I don't know, if this is the fastest method, but I think it is pretty fast. – Alina Feb 01 '23 at 09:07
  • I have counted 20 one-digit subtractions with the necessary digits needed to perform those. – WindSoul Feb 01 '23 at 14:32
2

We have $3267936$ which is a multiple of $4$ , while $1621$ is not.

Hence , we can remove the $4$ from $3267936$ to get $816984$ , which is still a multiple of $4$.
Hence , we can remove that $4$ too , to get $204246$.
We can then remove the $2$ to get $102123$.

Now , $1621$ ( ending in $1$ ) $\times$ $X3$ ( ending in $3$ ) will give $YYYYY3$ ( ending in $3$ ) [[ Here , $X$ is a Digit , while $Y$ is arbitrary Digit Placeholder ]]

$X=5$ is too small , it will give ~ $320YY$
$X=7$ is too large , it will give ~ $1120YY$

Hence , we have to only check $X=6$ , that is , $63 \times 1621$ to finish this. If that is $102123$ , we have divisibility. Else there is no divisibility.

It turns out that $63 \times 1621 = 102123$ : Hence we have Divisibility.

What we were given will be $4 \times 4 \times 2 \times 63 \times 1621 = 2016 \times 1621 = 3267936$

Prem
  • 14,696
  • 1
    You are doing a lot of divisions which costs a lot of time. It's impossible to do this in less than 15 seconds. – Alina Jan 08 '23 at 11:04
  • It is not "Costly Division" , it is only halving repeatedly , which is simple , @Alina , almost like multiplying by 10 which is simple & it is not "Costly" in terms of time. Working with Binary will give enough Practice in halving. – Prem Jan 08 '23 at 11:09
  • 1
    Halving is fast when you are working in binary, but here we have decimal digits. I have troubles to quickly find the half of let's say 57978. – Alina Jan 08 '23 at 11:21
  • Like multiplication tables make us quick with $6 \times 7$ & $8 \times 9$ , Practice with Binary makes Doubling Easy & fast $1,2,4,8,16,32,64,128,256,512,1024,2048,4096--$. Similarly , halving is Easy with Practice. We halve each Digit , taking care of Carry : "$5=2+Carry,17=8+Carry,19=9+Carry,17=8+Carry,18=9$" , @Alina , Hence , we get "$28989$" ! – Prem Jan 08 '23 at 12:14
2

I would try to construct the quotient one digit at a time using the right side digit of dividend in the current step of the process to guess the corresponding digit of the quotient. If at the end I obtained the given dividend then the division has no remainder and in the process I have obtained the quotient as well.

The method avoids division and subtraction however it does require guessing.

I call the dividend the number 3267936, the divisor the number 1621 and the quotient the number I try to determine such as the remainder of the division would be zero.

Step 1: choose the units digit of the quotinet in order to get the units digit of the dividend.

What times 1 ends in 6? That is 6, the units of quotient. $$\begin{align}&0001621\\\times&\underline{000xxx6}\\&000972\color{red}{6}\end{align}$$

After Step 1 I know that $1621\times xxx6=xxxxxx6$.

Step 2: choose the tenths digit of the quotient in order to obtain the tenths digit of the dividend.

I get a carryover of 2 from 6x2 in the previous multiplication.

Then figure out what times 1 plus 2 ends in 3? That is 1, the tenths unit of the quotient.

$$\begin{align}&0001621\\\times&\underline{000xx16}\\&0009726\\+&\underline{0016210}\\& xxxxx\color{red}{36}\end{align}$$

After Step 2 I know that $1621\times xx16=xxxxx36$

Step 3: choose the hundreds digit of the quotient to get the hundreds digit of the dividend.

I get two carryovers: 7 from first multiplication and 2 from the second, total 9.

Then figure out what times 1 plus 9 ends in 9? Obviusly 0, the hundreds digit of the quotient.

$$\begin{align}&0001621\\\times&\underline{000x016}\\&0009726\\&0016210\\+&\underline{0000000}\\& xxxx\color{red}{936}\end{align}$$

After Step 3 I know that $1621\times x016=xxxx936$.

Step 4

For the thousands digit: what times 1 plus 15 ends in 7? That must be 2.

$$\begin{align}&0001621\\\times&\underline{0002016}\\&0009726\\&0016210\\&0000000\\+&\underline{3242000}\\& \color{red}{3267936}\end{align}$$

After Step 4 I know that $1621\times 2016=3267936$.

WindSoul
  • 2,178
  • 1
    Nobody seems to understand this method or appreciate how fast it is. I had to write 4 lines 4 digits each, one line being all zeroes and another line being 1621 the result of multiplication by 1. Then the final answer-7 digits. Done by writing down some 19 digits at the speed of multiplication and/or addition. – WindSoul Jan 10 '23 at 19:13
1

Long division.

$1621 \times 2000 = 3,242,000.$

$25936$ remaining.

From the comments, I should now add that it should be obvious that only $16$ might work, as $1621\times 10<25936<1621\times 20$, and for $\ i\in\{1,\ldots,9\},\ $ only $\ i=6\ $ gives $\ 1 \times i = 6.$ For me, this took me less than a second to recognize, and I would expect the same for someone competing in contest math.

$1621 \times 16 = 25936.$

So actually yes.

I got this wrong the first time because I was rushing, so maybe $15$ seconds is too optimistic for this method.

Adam Rubinson
  • 24,300
1

The thing with these competitions is that you need to be very smart from the start with how you approach the question; choosing the fastest way possible that comes to mind.

Since it's easier to multiply than divide, it should be easier to try to approximate $1621$ to $3267936.$

Since we need $3$ more digits, we multiply by a $1000$ and we have $1\color{red}{6}21000$ and $3267936,$ now we multiply by a $2$ because a $3$ would be too big because of the $\color{red}6$ that yields an $8$ (or the better cause which is that $2$ is just perfect as it yields a $2,$ so to approximate further we will have to subtract and approximate $1621$ to the result i.e go a digit down.)

Thus, we subtract $3242000$ from $3267936$ to obtain $25936,$ so we have an initial factor of $2000.$

Now, we approximate $1621$ to $25936.$ We again multiply by $10$ to get $16210$ and notice we will have to subtract again i.e go a digit down again (or pretty much multiply by something between $10$ and $20$ since the subtraction doesn't affect the last digit.)

Since the last digit of $25936$ is $6$ and that of $1621$ is $1,$ I would guess $16,$ and wouldn't necessarily check if I don't have the time because when everything is nice and gets down to the very last step, you can assume the answer is positive.

This might sound a lot on paper, but for a trained mind, it's just basic arithematic with clever choice-making.

Stardust
  • 616