Given that 5 is a primitive element modulo 47, solve 10 ≡ 5 a mod 47 by using Shank’s algorithm
时间: 2024-06-05 22:08:05 浏览: 14
Shank's algorithm is an algorithm for solving the discrete logarithm problem. In this case, we want to solve the equation 10 ≡ 5^a (mod 47).
First, we need to find the order of 5 modulo 47. Since 47 is a prime number, we know that any integer a such that 1 ≤ a ≤ 46 is a primitive element modulo 47 if and only if gcd(a,47)=1 and a^(46) ≡ 1 (mod 47). Since 5 is a primitive element modulo 47, we know that the order of 5 modulo 47 is 46.
Next, we need to compute the values of 5^0, 5^1, 5^2, ..., 5^22 mod 47 and store them in a table. We can use the repeated squaring method to compute these values efficiently. For example:
5^0 ≡ 1 (mod 47)
5^1 ≡ 5 (mod 47)
5^2 ≡ 25 (mod 47)
5^3 ≡ 43 (mod 47)
5^4 ≡ 38 (mod 47)
5^5 ≡ 6 (mod 47)
5^6 ≡ 30 (mod 47)
5^7 ≡ 41 (mod 47)
5^8 ≡ 19 (mod 47)
5^9 ≡ 24 (mod 47)
5^10 ≡ 37 (mod 47)
5^11 ≡ 45 (mod 47)
5^12 ≡ 7 (mod 47)
5^13 ≡ 35 (mod 47)
5^14 ≡ 31 (mod 47)
5^15 ≡ 18 (mod 47)
5^16 ≡ 33 (mod 47)
5^17 ≡ 44 (mod 47)
5^18 ≡ 3 (mod 47)
5^19 ≡ 15 (mod 47)
5^20 ≡ 32 (mod 47)
5^21 ≡ 14 (mod 47)
5^22 ≡ 42 (mod 47)
Now, we can use Shank's algorithm to solve the equation 10 ≡ 5^a (mod 47). We can rewrite this equation as 5^a ≡ 10 (mod 47). We want to find a such that 0 ≤ a ≤ 45.
We start by dividing the range [0, 45] into two equal parts: [0, 22] and [23, 45]. We compute 10 × 5^-0 ≡ 10 (mod 47) and 5^0, 5^1, 5^2, ..., 5^22 mod 47 using the table. We find that 10 ≡ 10 (mod 47) and 10 ≢ 1, 5, 25, 43, 38, 6, 30, 41, 19, 24, 37, 45, 7, 35, 31, 18, 33, 44, 3, 15, 32, 14, 42 (mod 47). Therefore, 10 is not in the first half of the table.
Next, we compute 10 × 5^-23 ≡ 39 (mod 47) and 5^23, 5^24, 5^25, ..., 5^45 mod 47 using the table. We find that 39 ≢ 1, 5, 25, 43, 38, 6, 30, 41, 19, 24, 37, 45, 7, 35, 31, 18, 33, 44, 3, 15, 32, 14, 42 (mod 47). Therefore, 10 is not in the second half of the table.
Since we have exhausted all the possibilities, we conclude that there is no solution to the equation 10 ≡ 5^a (mod 47).
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)