Mode of remainders

Divide 1000 by each integer from 1 to 1000 and record their remainders.

Among the 1000 remainders recorded, what number do you see most frequently?


The answer is 10.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Mark Hennings
Jul 19, 2017

For any possible remainder 0 r 999 0 \le r \le 999 , the number 1000 1000 gives remainder r r when divided by 1 n 1000 1 \le n \le 1000 exactly when n > r n > r and n n divides 1000 r 1000 - r . Thus the frequency f r f_r of the remainder r r is equal to the number of divisors of 1000 r 1000 - r which are greater than r r .

Now 1000 10 = 990 = 2 × 3 2 × 5 × 11 1000 - 10 = 990 = 2 \times 3^2 \times 5 \times 11 has 2 × 3 × 2 × 2 = 24 2 \times 3 \times 2 \times 2 = 24 positive divisors. Of these, 1 , 2 , 3 , 5 , 6 , 9 , 10 1,2,3,5,6,9,10 are less than or equal to 10 10 . Thus we deduce that f 10 = 17 f_{10} = 17 . We want to determine whether there are any other integers 0 r 999 0 \le r \le 999 with f r 17 f_r \ge 17 . Note that 1000 = 2 3 × 5 3 1000 = 2^3 \times 5^3 has 4 × 4 = 16 4\times4=16 positive divisors, and so f 0 = 16 f_{0} = 16 . Also, since 999 = 3 3 × 37 999 =3^3 \times 37 , we have that f 1 = 4 × 2 1 = 7 f_1 = 4\times2 - 1 = 7 .

Suppose now that r 60 r \ge 60 . If 1 m 1000 1 \le m \le 1000 is such that m > r m > r and m m divides 1000 r 1000 - r , then 1000 r m < 1000 r r = 1000 r 1 1000 60 1 < 16 \frac{1000-r}{m} \; < \; \frac{1000 - r}{r} \; = \; \frac{1000}{r} - 1 \; \le \; \frac{1000}{60} - 1 \; < \; 16 Thus the integer 1000 r m \frac{1000-r}{m} can take at most 15 15 values, which means that there are at most 15 15 possible values of m m . In other words f r 15 f_r \le 15 .

If 2 r 59 2 \le r \le 59 and f r 17 f_r \ge 17 then (since 1 1 divides 1000 r 1000 - r ) we must have that 1000 r 1000 - r has at least 18 18 positive divisors. There are only four numbers 2 r 59 2 \le r \le 59 such that 1000 r 1000 - r has 18 18 or more positive divisors: 10 , 20 , 28 , 40 10,20,28,40 .

  • Note that 980 = 2 2 × 5 × 7 2 980 = 2^2 \times 5 \times 7^2 , 980 980 has 18 18 positive divisors, but at least two of them ( 1 1 and 2 2 ) are less than or equal to 20 20 . Thus f 20 < 17 f_{20} < 17 . In fact, f 20 = 10 f_{20} = 10 .
  • Note that 972 = 2 2 × 3 5 972 =2^2\times3^5 , 972 972 has 18 18 positive divisors, but at least two of them ( 1 1 and 2 2 ) are less than or equal to 28 28 . Thus f 28 < 17 f_{28} < 17 . In fact, f 28 = 9 f_{28} = 9 .
  • Note that 960 = 2 6 × 3 × 5 960 = 2^6 \times 3 \times 5 , 960 960 has 28 28 divisors, but a total of 16 16 of them are less than or equal to 40 40 . These 16 16 divisors are 1 , 2 , 4 , 8 , 16 , 32 , 3 , 6 , 12 , 24 , 5 , 10 , 20 , 40 , 15 , 30 1,2,4,8,16,32,3,6,12,24,5,10,20,40,15,30 . Thus f 40 = 12 f_{40} = 12 .

Thus the mode is 10 \boxed{10} .


Alternatively, the Mathematica command:

Sort[Tally[Table[Mod[1000, n], {n, 1, 1000}]], #1[[2]] > #2[[2]] &][[1]]

yields

{10,17}

giving the same answer!

Adhiraj Dutta
Jan 4, 2020

solution using C++ solution using C++ solution using Wolfram Mathematica solution using Wolfram Mathematica solution using Python 3 solution using Python 3

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...