How to resolve the algorithm Zsigmondy numbers step by step in the Phix programming language
How to resolve the algorithm Zsigmondy numbers step by step in the Phix programming language
Table of Contents
Problem Statement
Zsigmondy numbers n to a, b, are the greatest divisor of an - bn that is coprime to am - bm for all positive integers m < n.
Suppose we set a = 2 and b = 1. (Zs(n,2,1)) For each n, find the divisors of an - bn and return the largest that is coprime to all of am - bm, where m is each of the positive integers 1 to n - 1. When n = 4, 24 - 14 = 15. The divisors of 15 are 1, 3, 5, and 15. For m = 1, 2, 3 we get 2-1, 22-12, 23-13, or 1, 3, 7. The divisors of 15 that are coprime to each are 5 and 1, (1 is always included). The largest coprime divisor is 5, so Zs(4,2,1) = 5.
When n = 6, 26 - 16 = 63; its divisors are 1, 3, 7, 9, 21, 63. The largest divisor coprime to all of 1, 3, 7, 15, 31 is 1, (1 is always included), so Zs(6,2,1) = 1.
If a particular an - bn is prime, then Zs(n,a,b) will be equal to that prime. 25 - 15 = 31 so Zs(5,2,1) = 31.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Zsigmondy numbers step by step in the Phix programming language
Source code in the phix programming language
You may also check:How to resolve the algorithm Tau function step by step in the Java programming language
You may also check:How to resolve the algorithm Averages/Arithmetic mean step by step in the Liberty BASIC programming language
You may also check:How to resolve the algorithm Search a list of records step by step in the Julia programming language
You may also check:How to resolve the algorithm Sorting algorithms/Quicksort step by step in the Logtalk programming language
You may also check:How to resolve the algorithm Ackermann function step by step in the Hare programming language