2015-01-14

Maths for the Lazy


A long time ago, Bengt was in school, and his teacher taught him some nifty tricks for checking divisibility.
Checking if something is divisible by 10 is obviously easy, as you only need to look at the last digit. This also applies to 2 and 5, being factors of 10.
Checking if something is divisible by 9 can be done by adding up all the digits in the number, and seeing if that number is divisible by 9. This also applies to 3, being a factor of 9.
Checking if something is divisible by 11 can be done by alternatingly adding and subtracting the digits in the number. If you get 0 or a number which is divisible by 11, the original number is also divisible by 11.
That's all good and well, but there are plenty of numbers left. How do you know if something is divisible by 7, for example? Clearly, Bengt reasons, we need to use another number base. But which one?
  1. If we have another number base, how will these things generalise? With base b, the first trick should clearly generalise to all factors of b. But can we also check all factors of b-1 and b+1? Or only the prime factors? Or some other restriction?
  2. If we can check all prime numbers, the rest shouldn't be much of a problem. What's the lowest possible base, if we want to check divisibility by 2, 3, 5 and 7?
  3. ...and 11?
  4. ...and 13?
  5. Is there a quick way to figure it out for the first n prime numbers?

2015-01-03

The Roundest of Numbers


Bengt is planning to build a... patio, I guess? Anyway, he's designing a pattern made of little square stones in a square grid. Some of the stones are in a darker colour, and Bengt wants to make those into a (filled) circle. Clearly, he can only make an approximation of a circle, much like on a computer screen. But how many dark stones should he buy? That depends of course on how big the circle should be, but some numbers are never a good choice, regardless of the size of the circle.

We can think of an imaginary circle laid out on the patio grid. Now we need to decide on a rule for how many stones should be dark. It could be
1. those which have any part inside the circle, with the circle adjusted on the grid to minimise the number of dark stones; that is, the minimum number of square grid cells needed to cover a circle of a given diameter
2. those which are entirely covered by the circle, with the circle adjusted on the grid to maximise this number; that is, the maximum number of square grid cells that can be covered by a cirlce of a given diameter
3. those whose midpoint is inside the circle (or on the periphery), with any grid/circle adjustment possible
 For example, for the first case, a circle of diameter 2 would correspond to 4 stones. But there is no circle corresponding to 5 stones - any circle that can be covered by 5 grid cells can also be covered by 4. 5 is not, as Bengt puts it, a round number, by this definition. For the last case, with diameter 1, we could fit in 0, 1 or 2 midpoints depending on the "phase shift" of the grid and the circle, so those are all round numbers.
  1. According to the first definition, which are the round numbers up to, say, 20?
  2. And the second definition?
  3. And the third?
  4. Can you find a good general method for checking if a number is round, according to the different definitions?
  5. Hexagonal grid!
  6. 3D grid!
  7. Higher dimensions!