Given a number, determine whether it is a valid Hyperperfect Number.
A number n is called k-hyperperfect if: n = 1 + k ∑idi where all di are the proper divisors of n.
Taking k = 1 will give us perfect numbers.
The first few k-hyperperfect numbers are 6, 21, 28, 301, 325, 496, 697, … with the corresponding values of k being 1, 2, 1, 6, 3, 1, 12, …
Input : N = 36, K = 1 Output : 34 is not 1-HyperPerfect Explanation: The Divisors of 36 are 2, 3, 4, 6, 9, 12, 18 the sum of the divisors is 54. For N = 36 to be 1-Hyperperfect, it would require 36 = 1 + 1(54), which we see, is invalid Input : N = 325, K = 3 Output : 325 is 3-HyperPerfect Explanation: We can use the first condition to evaluate this as K is odd and > 1 so here p = (3*k+1)/2 = 5, q = (3*k+4) = 13 p and q are both prime, so we compute p^2 * q = 5 ^ 2 * 13 = 325 Hence N is a valid HyperPerfect number
1570153 is 12-HyperPerfect 321 is not 3-HyperPerfect
Given k, we can perform a few checks in special cases to determine whether the number is hyperperfect:
- If K > 1 and K is odd , then let p = (3*k+1)/2 and q = 3*k+4 . If p and q are prime, then p2q is k-hyperperfect
- If p and q are distinct odd primes such that K(p + q ) = pq – 1 for some positive integral value of K, then pq is k-hyperperfect
This article is contributed by Deepak Srivatsav. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Determine whether the given integer N is a Peculiar Number or not
- Determine the number of squares of unit area that a given line will pass through.
- Program to determine the Quadrant of a Complex number
- Program to determine the quadrant of the cartesian plane
- Program to determine focal length of a spherical mirror
- Program to determine the octant of the axial plane
- Determine the count of Leaf nodes in an N-ary tree
- Determine the position of the third person on regular N sided polygon
- Determine winner of the Game by arranging balls in a row
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Check whether the given number is Euclid Number or not
- Check whether given number N is a Moran Number or not
- Check whether a given number N is a Nude Number or not
- Check whether a given number is an ugly number or not
- Check whether a given number is even or odd
- Check whether a very large number of the given form is a multiple of 3.
- Check whether a given number is Polydivisible or Not
- Check whether a given Number is Power-Isolated or not
- Check whether the given number is Wagstaff prime or not
- Check whether a number has consecutive 0's in the given base or not
Improved By : jit_t