ROSECODE 335
Diagonal Enumeration
You certainly know of this nice proof of the equipotence between the set of integers and the set of rational numbers.
We consider an infinite grid numbered horizontally and vertically with integers:
We run through this grid according the above pattern and count each pair (i,j) where i and j are coprime.
We obtain the following bijection:
We consider an infinite grid numbered horizontally and vertically with integers:
We run through this grid according the above pattern and count each pair (i,j) where i and j are coprime.
We obtain the following bijection:
-
1 -
2 -
3 -
4 -
5 -
6 -
7 -
8 -
9 -
10 -
11 -
12 -
13 -
14 -
15 -
16 -
17 -
If we run through the upper diagonal matrix of a
How many rationals can we count in the upper diagonal matrix of a
You are given: 303964542391 for a
[My timing: < 90 sec]