Let's say we have whole numbers from 2 to 31 (imagine them as blocks). We also have a number that is not divisible by two of those numbers that are next to each other on the number line but that number is divisible by the other numbers.

For example, we have only three numbers 2, 3 and 4 and want to find just one that cant divide some number that those others can, for example, the number 6 which cant be divided by 4(in this example there are multiple answers but in the actual problem just one).

What are those two numbers? Our maths teacher gave us this problem in the 5th grade and it's still bugging me. Can somebody explain it, please?

  • $\begingroup$ What about $7$? It is not divisible by $3$ or $2$, which are next to each other... $\endgroup$
    – Dr. Mathva
    Mar 15, 2019 at 18:49
  • $\begingroup$ question is not clear, try providing examples(even from any other set) $\endgroup$ Mar 15, 2019 at 19:00
  • $\begingroup$ OP is saying that there is some very big natural number that is divisible by all but two adjacent elements of the set $\{2,3,\ldots,31\}$, and the fact that this number exists uniquely determines what those two elements are. $\endgroup$
    – K B Dave
    Mar 15, 2019 at 19:07

1 Answer 1


There are eleven primes in the range from $2$ to $31$: $$ 2,3,5,7,11,13,17,19,23,29,31; $$ so these are the only primes that "some number" might need to be divisible by. But some of these primes (the first three) also appear to higher powers in this range: we have $2,4,8,16$; $3,9,27$; and $5,25$. In each case, the largest one will take care of the rest, so the list of prime-power factors that need to be considered are these: $$ 7,11,13,16,17,19,23,25,27,29,31. $$ A number is divisible by all the numbers from $2$ to $31$ if it is divisible by all of these. Conversely, if it is not divisible by some number in the list, it is not divisible by one of these. So we want to find two of these to remove, but only one pair are consecutive numbers: $16$ and $17$. So the number we are looking for is divisible by all the other nine numbers listed, but not by $16$ or $17$. The smallest such number is the product of those nine, along with the next smaller power of $2$ (namely, $8$): $$ 7\cdot8\cdot11\cdot13\cdot19\cdot23\cdot25\cdot27\cdot29\cdot31 = 2123581660200. $$


Not the answer you're looking for? Browse other questions tagged or ask your own question.