Help please solve the problem.
Gordon's algorithm for generating a strongly prime number:
Generate two large primes s and t of the same length.
Select the number i0 . Find the first prime number in the sequence 2it + 1 , where i = i0 , i = i + 1 , .... Designate this number r = 2it + 1 .
Calculate p0 = 2 (s ^ r-2 mod r) s - 1 .
Choose the number j0 . Find the first prime number in the sequence p0 + 2jrs , where j = j0 , j = j + 1 , .... Denote this number p = p0 + 2jrs .
Return p .
Implemented all items except 2 and 4 .
In the second paragraph, you need to find the number r .
In the fourth paragraph, you need to find the number p .
Perhaps in both points you need to use cycles, but I still do not understand how to write them correctly to calculate the numbers r and p .
# Пункт 1 s = 78479 # Сгенерированное число s t = 86399 # Сгенерированное число t # Пункт 2 i0 = 3 # Выбранное число i0 r = None # Проблема здесь # Пункт 3 p0 = 2 * (pow(s, r - 2) % r) * s - 1 # Вычисленное число p0 # Пункт 4 j0 = 9 # Выбранное число j0 p = None # Проблема здесь # Пункт 5 print(p) # Вывод числа p