Given an integer N and a base number A, the task is to check whether N is a Euler Pseudoprime to the given base A.
An integer N is called Euler Pseudoprime to the base A, if
- A > 0 and N is an odd composite number.
- A and N are co-prime i.e. GCD(A, N) = 1.
- A(N – 1) / 2 % N is either 1 or N – 1.
Input: N = 121, A = 3
Input: N = 343, A = 2
Approach: Check all the given conditions for Euler Pseudoprime. If any one of the conditions is not true then print No else print Yes.
Below is the implementation of the above approach:
Time Complexity: O(sqrt(N))
- Check if a number is Fermat Pseudoprime
- Euler's criterion (Check if square root under modulo p exists)
- Project Euler
- Euler's Factorization method
- Euler's Totient Function
- Euler's Four Square Identity
- Euclid Euler Theorem
- Count of elements having Euler's Totient value one less than itself
- Euler tour of Binary Tree
- Euler Method for solving differential equation
- Euler zigzag numbers ( Alternating Permutation )
- Optimized Euler Totient Function for Multiple Evaluations
- Euler's Totient function for all numbers smaller than or equal to n
- Count integers in a range which are divisible by their euler totient value
- Total nodes traversed in Euler Tour Tree
- Predictor-Corrector or Modified-Euler method for solving Differential equation
- Check if a number is divisible by all prime divisors of another number
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Program to check whether a number is Proth number or not
- Check if the number is a Prime power number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.