Let fk(n) be the periodic sequence 1,2,3,...k,1,2,3...k,1,2,3...1,2,3,...k,...
fk(2^t) is periodic, t=0,1,2,3....
Example: k =7
1*,2*,3,4*,5,6,7,1*,2,3,4,5,6,7,1,2*,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4*,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1*,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2*,3,4,5,6,7,.....
The numbers with astetisks is the sequence f7(2^t)
Let k be odd
k = 1 : period : 1
k = 3 : period : 1,2
k = 5 : period : 1,2,4,3
k = 7 : period: 1,2,4
k= 9 : period: 1,2,4,8,7,5
k = 11: period: 1,2,4,8,5,10,9,7,3,6
k = 13: period: 1,2,4,8,3,6,12,11,9,5,10,7
k = 15: period: 1,2,4,8
k = 17: period: 1,2,4,8,16,15,13,9
k = 19: period: 1,2,4,8,16,13,7,14,9,18,17,15,11,3,6,12,5,10
k = 21: period: 1,2,4,8,16,11
Let p(k) be the number of the terms of the period (length of the period)
p(k) is the rank of 2 modulo k ie p(k) is the least number x such that 2^x - 1 = 0 (mod k)
For k = 1, the least x such that 2^x - 1 = 0 (mod 1) is 1: 2^1 - 1 = 1 = 1.1
For k = 3, the least x such that 2^x - 1 = 0 (mod 3) is 2: 2^2 - 1 = 3 = 1.3
For k = 5, the least x such that 2^x - 1 = 0 (mod 5) is 4: 2^4 - 1 = 15 = 3.5
For k = 7, the least x such that 2^x - 1 = 0 (mod 7) is 3: 2^3 - 1 = 7 = 1.7
For k = 9, the least x such that 2^x - 1 = 0 (mod 9) is 6: 2^6 - 1 = 63 = 7.9
For k =11, the least x such that 2^x - 1 = 0 (mod 11) is 10: 2^10 - 1 = 1023 = 93.11
For k =13, the least x such that 2^x - 1 = 0 (mod 13) is 12: 2^12 - 1 = 4095 = 315.13
For k =15, the least x such that 2^x - 1 = 0 (mod 15) is 4: 2^4 - 1 = 15 = 1.15
For k =17, the least x such that 2^x - 1 = 0 (mod 17) is 8: 2^8 - 1 = 255 = 15.17
For k =19, the least x such that 2^x - 1 = 0 (mod 19) is 18: 2^18 - 1 = 262144 = 13797.19
For k =21, the least x such that 2^x - 1 = 0 (mod 21) is 6: 2^6 - 1 = 63 = 3.21
......
For k = 1,3,5,7,..... we have the sequence: 1,3,15,7,63,1023,4095,15,255,262144,3......
Let 2^p(k) -1 = M(k).k
M(k): 1,1,3,1,7,93,315,1,15,13797,3,.... = A165781
p(k) = k - 1 ==> k is prime of the sequence : 3, 5, 11, 13, 19, 29, 37, 53, 59, 61, 67, 83, ...... = A001122
____________FIGURATE_________________
Let 123456...k be a regular k-gon.
We start from 1 and move clockwise and put 1 inside the polygon before 2.
From 2 we move clockwise and put 2 inside the polygon before 4.
From 4 we move clockwise and put 4 inside the poygon before 8.
....
We repeat this counting and moving until we reach a number we have reached already. Then we stop since we have a loop.
Examples for k = 3,5,7,9,11,13,15,17,19,21.