Re: swotting the old CCNA books?
Fun with number representation - the factorial basis.
Consider this series:
0,1,10,11,20,21,100,101,110,111,120,121,200,201,210,211,220,221,300,301,310,311,320,321,1000,1001...
The kth digit can take on values 0...k. The last number before a turnover of digits is k.(k-1).(k-2)...321. Thus 7654321 + 1 = 10000000.
Now, it so happens that
100....00 (k zeros) is the representation of (k+1)! = (k+1)k(k-1)(k-2)..1 and by definition 0! = 1.
Thus a number in this representation can be written
A = sum(0..k) An * n!
where 0 <= An <= n.
What are the primes?
2 = 10
3 = 11
5 = 21
7 = 101
11 = 121
13 = 201
17 = 221
19 = 301
23 = 321
29 = 1021
31 = 1101
37 = 1201
41 = 1221
Here are all the primes up to 719 = 6!-1 ;
0 0 0 1 0
0 0 0 1 1
0 0 0 2 1
0 0 1 0 1
0 0 1 2 1
0 0 2 0 1
0 0 2 2 1
0 0 3 0 1
0 0 3 2 1
0 1 0 2 1
0 1 1 0 1
0 1 2 0 1
0 1 2 2 1
0 1 3 0 1
0 1 3 2 1
0 2 0 2 1
0 2 1 2 1
0 2 2 0 1
0 2 3 0 1
0 2 3 2 1
0 3 0 0 1
0 3 1 0 1
0 3 1 2 1
0 3 2 2 1
0 4 0 0 1
0 4 0 2 1
0 4 1 0 1
0 4 1 2 1
0 4 2 0 1
0 4 2 2 1
1 0 1 0 1
1 0 1 2 1
1 0 2 2 1
1 0 3 0 1
1 1 0 2 1
1 1 1 0 1
1 1 2 0 1
1 1 3 0 1
1 1 3 2 1
1 2 0 2 1
1 2 1 2 1
1 2 2 0 1
1 2 3 2 1
1 3 0 0 1
1 3 0 2 1
1 3 1 0 1
1 3 3 0 1
1 4 1 0 1
1 4 1 2 1
1 4 2 0 1
1 4 2 2 1
1 4 3 2 1
2 0 0 0 1
2 0 1 2 1
2 0 2 2 1
2 0 3 2 1
2 1 0 2 1
2 1 1 0 1
2 1 2 0 1
2 1 2 2 1
2 1 3 0 1
2 2 0 2 1
2 2 3 0 1
2 2 3 2 1
2 3 0 0 1
2 3 0 2 1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