# Development ofAlgorithmic Constructions

 22:21:01 26.Jan 2022

29 31 33

 Number p=

### Calculation

a^2+(bI)^2 = a^2-b^2 = 1 mod p

Distance to the middle point
ph=(prim-1)/2;
if (i < ph) m_i=i;
else m_i=prim-i;

if (j < ph) m_j=j;
else m_j=prim-j;

dist=(m_i^2+m_j^2) % prim;

Potence 2 Potence 3 Potence 5 Potence 7 Potence 11 Potence 13 Potence 17 Potence 19 Potence 23 Potence 29

### Number = 31, Exponent = 1, 31 = 3 mod 4, 31 = 7 mod 8

 30 0 30 I
Number of elements = 30

### Number = 31, Exponent = 1, 31 = 3 mod 4, 31 = 7 mod 8

Potence 2 Potence 3 Potence 5 Potence 7 Potence 11 Potence 13 Potence 17 Potence 19 Potence 23 Potence 29

 30^2-0^2=130*0=0dist=1 28^2-15^2=128/15=628*15=17dist=19 28^2-16^2=128/16=2528*16=14dist=16 25^2-2^2=125/2=2825*2=19dist=0 25^2-29^2=125/29=325*29=12dist=0 23^2-1^2=123/1=2323*1=23dist=9 23^2-30^2=123/30=823*30=8dist=9 22^2-7^2=122/7=1222*7=30dist=2 22^2-24^2=122/24=1922*24=1dist=2 19^2-9^2=119/9=919*9=16dist=5 19^2-22^2=119/22=2219*22=15dist=5 17^2-3^2=117/3=1617*3=20dist=9 17^2-28^2=117/28=1517*28=11dist=9 16^2-10^2=116/10=1416*10=5dist=1 16^2-21^2=116/21=1716*21=26dist=1 15^2-10^2=115/10=1715*10=26dist=30 15^2-21^2=115/21=1415*21=5dist=30 14^2-3^2=114/3=1514*3=11dist=9 14^2-28^2=114/28=1614*28=20dist=9 12^2-9^2=112/9=2212*9=15dist=5 12^2-22^2=112/22=912*22=16dist=5 9^2-7^2=19/7=199*7=1dist=2 9^2-24^2=19/24=129*24=30dist=2 8^2-1^2=18/1=88*1=8dist=9 8^2-30^2=18/30=238*30=23dist=9 6^2-2^2=16/2=36*2=12dist=0 6^2-29^2=16/29=286*29=19dist=0 3^2-15^2=13/15=253*15=14dist=19 3^2-16^2=13/16=63*16=17dist=16 1^2-0^2=11*0=0dist=1