Find Values of P and Q Satisfying the Equation N = P^2.Q
In this tutorial, we will explore how to determine values of P and Q satisfying the given equation.
A whole number higher than 1 whose only elements are 1 and itself is referred to as a prime number. A whole number that may be split evenly into another number is referred to as a factor. 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29 are the first few prime numbers. Composite numbers are those that have more than two components. Neither prime nor composite, number one.
The goal is to determine P and Q that satisfy the expression N = P^2.Q, where P and Q are prime numbers, provided a number N(1 ≤ N ≤ 9×1018). P and Q must be prime numbers.
The execution of the aforementioned concept is shown below:
(If we input the value of N as 2023)
Put a value of N: 2023 P is 17 Q is 7
(If we input the value of N as 175)
Put a value of N: 175 P is 5 Q is 7
(If we input the value of N as 158)
Put a value of N: 158 P is 9 Q is 2
(If we input the value of N as 254)
Put a value of N: 254 P is 11 Q is 2
P is 17 Q is 7
P is 5 Q is 7
So that's the end of the article. I sincerely hope you find this post to be educational and useful.
Next TopicWhat is the Balance Factor of AVL Tree