# Development ofAlgorithmic Constructions

 17:42:52 20.Mar 2023

1. Abstract
2. Transformation
3. Mathematical proofs
4. Symmetry
5. Program in pseudocode
6. Webprogram for the demonstration 7. Links

## 1. Abstract

There is a relationship between the primitiv Pythagorean triples (a,b,c) with a²+b²=c²
resp. the corresponding rational points of the circle with unit 1 (a/c)²+(b/c)²=1
and the group of the complex elements x²+y²=1 mod p where x, y are elements of Np.

In addition there is a similar relationship between the primitiv Pythagorean triples
resp. the corresponding rational points (c/b)²-(a/b)²=1 resp. (c/a)²-(b/a)²=1
and the group of the complex elements with x²-y²=1 mod p where x, y are elements of Np.

These relationships are one explication for the system of primes.

## 2. Transformation

 Pythagorean triples ---> complex vectorin the circle of unit 1 ---> group of complex elements |a+bI|=1 mod p with a,b element Np Pythagorean triples ---> complex vectorsine hyperbola / cos hyperbola ---> group of complex elements a²-b²=1 mod p with a,b element Np

## 3. Mathematical proofs

```    p an odd number > 1
Let a,b,c a Pythagorean triple with c < p

a)    a²     + b²       = c²             by multiplication with (c²)⁻1
<=> (a/c)² +(b/c)²      = 1              with I²=-1
<=> (a/c)² -(bI/c)²     = 1

```
```
b)    a²     + b²       = c²             - b²
a²                = c² -  b²       by multiplication with (a²)⁻1
<=> (c/a)² - (b/a)²     = 1              with I²=-1
<=> (a/c)² +(bI/c)²     = 1

```
```
c)    same caluclation, just -a² instead of -b²

a²     + b²         = c²             - a²
b²    = c² -  a²       by multiplication with (b²)⁻1
<=> (c/b)² - (a/b)²     = 1              with I²=-1
<=> (c/b)² +(aI/b)²     = 1

```

## 4. Symmetry

The symmetry of the resulting group of the complex elements with norm=1
based on the commutativ structur of this group

a²+b²=b²+a²=c² resp.
(a/c)²-(bI/c)²=(b/c)²-(aI/c)²=1
and that x²+y²=(p-x)²+y²=x²+(p-y)²=(p-x)²+(p-y)² mod p;

Therefore one Pythagorean triple gives always 4 or 8 solutions with |x+YI|=1 mod p

The first trivial Pythagorean triple (0,1,1) gives the 4 solution (0,1), (1,0), (0,p-1) and (p-1,0).

If a Pythagorean triple has as result (x, y) with x=y then there are the following 4 solutions:
(x, x), (x, p-x), (p-x, x) and (p-x, p-x)

Otherwise there are 8 solutions for (x, y):
(x, y), (x, p-y), (p-x, y) and (p-x, p-y) and
(y, x), (y, p-x), (p-y, x) and (p-y, p-x)

## 5. Program in pseudocode

This is not a practical test for prime numbers, but a short description, how the webprogram works.
```Let p an odd number > 1;
prime=True;
for i from all pyth. triples (a, b, c) with c < p
if (gcd (c, prim)>1) then prime=False; break;
calculation (a,b,c)-> (x, y);
if (gcd (x, prim)>1) then prime=False; break;
if (gcd (y, prim)>1) then prime=False; break;
output of all elements of (x,y);
end_for;
if prime=True then p is prime;
```

## 6. Webprogram for the demonstration

p < 200 table of Pythagorean triples + graphic is shown + table with elements
p < 500 table of Pythagorean triples + graphic is shown
p < 10000 table of Pythagorean triples is shown

 Number p=

### p = 31

gcd (u,v)=1; u odd and v even, u even and v odd; u²+v² < 31

 (2, 1); (3, 2); (4, 1); (4, 3); (5, 2);

a, b, c is the Pythagorean triple with a²+b²=c²

 nr. u, v a b c -> (x,y) with |x+yI|=1 number of elements factor ^n=1 (x,y) with x²-y²=1 number of elements factor ^n=1 0. 1,0 1=1²-0² 0=2*1*0 1=1²+0² -> (0,1), (1,0), (0,30), (30,0), 4 2 (1,0), (30,0), 2 1 1. 2,1 3=2²-1² 4=2*2*1 5=2²+1² -> (7,13), (18,7), (13,24), (18,24), (13,7), (7,18), (24,13), (24,18), 8 8 (9,12), (22,12), (9,19), (22,19), (7,9), (24,9), (7,22), (24,22), 8 8 2. 3,2 5=3²-2² 12=2*3*2 13=3²+2² -> (2,11), (29,11), (2,20), (29,20), (11,2), (11,29), (20,2), (20,29), 8 16 (10,15), (21,15), (10,16), (21,16), (3,14), (28,14), (3,17), (28,17), 8 32 3. 4,1 15=4²-1² 8=2*4*1 17=4²+1² -> (5,10), (21,5), (10,26), (21,26), (10,5), (5,21), (26,10), (26,21), 8 16 (3,15), (28,15), (3,16), (28,16), (2,6), (29,6), (2,25), (29,25), 8 2 4. 4,3 7=4²-3² 24=2*4*3 25=4²+3² -> (4,4), (27,4), (4,27), (27,27), 4 4 (1,8), (30,8), (1,23), (30,23), 4 1 5. 5,2 21=5²-2² 20=2*5*2 29=5²+2² -> (5,10), (26,10), (5,21), (26,21), (10,5), (10,26), (21,5), (21,26), 0 16 (2,6), (29,6), (2,25), (29,25), (3,15), (28,15), (3,16), (28,16), 0 16 32 30

number of primitiv pythagorain triples : 5
31 /(2*5) = 3.1

 30 I 0 30

### Number = 31, 31 = 3 mod 4

 |0+30I|=1 |11+29I|=1 |20+29I|=1 |4+27I|=1 |27+27I|=1 |10+26I|=1 |21+26I|=1 |13+24I|=1 |18+24I|=1 |5+21I|=1 |26+21I|=1 |2+20I|=1 |29+20I|=1 |7+18I|=1 |24+18I|=1 |7+13I|=1 |24+13I|=1 |2+11I|=1 |29+11I|=1 |5+10I|=1 |26+10I|=1 |13+7I|=1 |18+7I|=1 |10+5I|=1 |21+5I|=1 |4+4I|=1 |27+4I|=1 |11+2I|=1 |20+2I|=1 |0+1I|=1 |1+0I|=1 |30+0I|=1

 30 I 0 30

### Number = 31, 31 = 3 mod 4

 8²-30²=1 23²-30²=1 6²-29²=1 25²-29²=1 14²-28²=1 17²-28²=1 9²-24²=1 22²-24²=1 12²-22²=1 19²-22²=1 15²-21²=1 16²-21²=1 3²-16²=1 28²-16²=1 3²-15²=1 28²-15²=1 15²-10²=1 16²-10²=1 12²-9²=1 19²-9²=1 9²-7²=1 22²-7²=1 14²-3²=1 17²-3²=1 6²-2²=1 25²-2²=1 8²-1²=1 23²-1²=1 1²-0²=1 30²-0²=1

 30 I 0 30