# A funny numeration system

When I swim at the pool of Antibes, I usually count the laps I do. It is just an obsession, I just feel good when I know how many laps I did.

At first I was using the regular decimal system, but after a while I found it a bit boring. So I progressively shifted to other kinds of counting methods, just to conjugate the water I was swallowing with some mathematical brain-twisting fun.

That’s how I ended up counting in other languages (German, Chinese or Swedish) and in other numeral system: Roman, binary, octal, duodecimal, hexadecimal.
Since I often try to do 40 laps, that makes me count up to vierzig, 四十, fyrtio, XL, 101000, 050, 34, x28.

But lately, I had the idea to count in a new interesting numeral system, and I would like to share it in this post. I have not found a lot of posts dealing with this kind of counting system (at least I think Kurt Gödel used it somehow) and I even do not really know if it has practical applications (let’s keep these reflexions for the conclusion). But at least it find it is quite funny to count with it.

### The numeration system

The fundamental theorem of arithmetic states that every integer can be written as a unique product of prime numbers.

That’s why and .

So I thought: why cannot we use this uniqueness to write numbers? We could take primes as the base of the system and for each, we assign a number, the exponent.
In that system 240 would be written something like a list of tuples: (2,4),(3,1),(5,1). Or better, we could use a positional system where the position will be the prime number position in the list of prime numbers, and the number assigned to the position will be the exponent.
For example, the number 240 would be written 411 since 2, 3 and 5 are the 1st, 2nd and 3rd prime numbers. And for 1170, it is: 121001.

But since the exponent is itself a number, you cannot write it in base 10. So let’s write it in the same prime-number-decomposition system. I will put bracket around the position. In that system it seems you end up only needing brackets, 0 and 1…
In that system, the number becomes , and that is why the number 240 should then be written .

So let’s count from 1 to 10!

### Counting to 10000

Back from the swimming pool, I was wondering: that would be great to count even higher. Let’s program a little. That’s how I ended up writing some Python script to count up to 10000 with that method.
It is not really complicated admittedly, and if we assume having a function `fac(n)` to get the decomposition of an integer in prime numbers, this is the program you can use to count numbers1:

```num = 10000
result = {1: '0'}
primes = []
maxlength = 0
for n in range(2,num+1):
f = fac(n)
if len(f) == 1:
primes.insert(0,f[0])
s = '1'+'0'*maxlength
maxlength += 1
else:
s = ''
b = False
for p in primes:
c = f.count(p)
if c==0:
if(b):
s += '0'
elif c==1:
s += '1'
b = True
else:
s += ('['+result1+']')
b = True
result[n] = s
print(repr(n).ljust(6),s)
```

The result: the complete numeration from 1 to 10000 can be found here

For the factorization in prime numbers I used the pyecm script, which uses the Elliptic curve method for the factorization. Since the script is not adapted for a version of Python higher than 3, I did adapt it a little. The complete source code is here (note that this source code is licensed under GNU GPL).

### Is it useful?

My answer is NO. Don’t use it at home!
I have several reason to think this numeral system is far from being useful in everyday’s life (at least when you are not swimming laps):

• Small number can be very long to write. For example 2012 is written 10000000000000000000000110, which is also very hard to understand!
• To write a number, you need to know how the number before were written. And you also need to know the list of prime number by heart.
• To write a given number you need to decompose numbers in primes, which is far from being an easy exercise!

Besides, I do not see any practical use of this notation. If it is easy to multiply and get the GCD/LCM of two numbers, there is no obvious way to divide and add them to each other…

1. Note that I did not pay a lot of attention concerning the memory consumption of this method. Storing the list of primes and most of all the complete numeration in a dictionary is not the cleverest idea! []

# Origami and Egyptian triangles (the Haga theorem)

I think most of us have only been taught Euclidian geometry at school. A ruler and a compass, the solid axioms of the Elements, and here we go!…

But as you probably know, even if it is pretty good to describe quite a lot of things, the Euclidian geometry suffers from some limitations. The famous Greek examples are doubling the cube (or the delian problem), the angle trisection and squaring the circle. We had to wait for the 19th century to show these problems where impossible to solve with the Euclidian geometry (i.e. with a ruler and compass only).

That is why other people invented other types of geometry. Thus, I lately came across some Web articles about origami geometry and I was quite surprised how powerful it is: it is indeed possible to solve some of the impossible problems above with origamis1. It was quite a revolution in my mind ! And where I am the most impressed is that you can achieve a lot with very limited materials: paper and folding…

The thing I did not know is that it exists many publications and theorems about origamis, although this field of research gained most of its popularity in the 20th centry. In this post, I will just give you an example (and a demonstration) of a famous theorem one can find about origami : the Haga theorem.

I like this theorem because it is very easy to understand and shows how you can have interesting geometrical reasonning from origamis. The demonstration is also not very complicated: you do not need more than highschool student geometrical notions to understand it.

### The Haga Theorem

The Haga theorem comes from Kazuo Haga, a Japanese retired professor of biology from the University of Tsukuba.

To see what this theorem is, you first need a square piece of paper2. I really encourage you to do it at home because it is very visual.

Fold this square in two. Here is what you get:

So, the next step is simply to fold the paper so that the corner C goes to the point S, the place where the paper was folded in half. You should end up with something like this::

That’s all! The Haga theorem simply says:

But actually, I prefer to rephrase it like this:

The triangles SAV, SBT and TDU are all Egyptian triangles.

What are Egyptian triangles? Maybe we need some explanations…

### Egyptian triangles

You should be familiar with the famous Pythagorean theorem stating that in a right triangle, the square of the length of the hypothenuse (the longest side) is equal to the sum of the squares of the length of the two other sides.

You may also know that the converse of this statement is true: if you have a triangle so that the square of the longest side is equal to the sum of the squares of the other sides, then you have a right triangle.

If the theorem have the name of the famous Greek mathematician of Samos, it seems that more ancient civilizations already know this laws, e.g. the Egyptians.
They indeed used a quite powerful tool: a rope with 13 knots evenly distributed. With this rope, they were able to draw right triangle very easily.
Here is how it works:

You take the rope so that you create a triangle with the length 3, 4 and 5. This is a pythagorician triplet, because and that shows that the triangle is a right triangle. You can then used the rope to do draw right angles and build pyramids!

This is where we have our definition: an Egyptian triangle is a right triangle which is similar to this rope-made triangle. Similar means that one triangle has the same shape but maybe with a different scaling. For example, the right triangle with the sides of length 6, 8 and 10 is an Egyptian triangle (because the length are the double of the rope triangle).

### Go back to the origami

Let’s go back to the Haga theorem, we say we have SAV, SBT and TDU as Egyptian triangles, which means that they are all similar to the (3,4,5) triangle made of rope.

First, we demonstrate that these triangles are similar. We demonstrate this by showing that they all have the same angles. It is a property of similar shapes to have the same angles.
Since the sum of the angles in a triangle is always equal to 180° (or if you prefer). We can show with no difficulties that the angles of the triangles ASV and SBT are the same (as show on the figure).
Concerning angles and they are the same because they are vertically opposite. We can therefore conclude to the similarity between triangles SBT and TDU (and therefore SAV).

Let’s show now that the triangle SAV is Egyptian. For that we will assume the length of the side of the initial square piece of paper is 8. That means the length of AS is 4.

We will now try to find the value of AV.

We have
And Pythagoras says:
Then:

So we have , , and . Hey, that’s an Egyptian triangle!
And since SAV is similar to SBT and TDU, we have show that all these triangles are Egyptian! Q.E.D.

(Origami crane photography author: Andreas Bauer (Origami-Kunst)

1. at least doubling the cube and the angle trisection problems []
2. I let you figure out how you can get a square from a A4 piece of paper []