Given a ‘n’ digit number x, check if it is a plus perfect number or not. A number is plus perfect number if it is equal to the sum of its digits raised to the nth power.
Input : x = 371 Output : Yes Explanation : Number of digits n = 3 (3*3*3) + (7*7*7) + (1*1*1) = 371 Input : x = 9474 Output : Yes Explanation : Number of digits n = 4 (9*9*9*9) + (4*4*4*4) + (7*7*7*7) + (4*4*4*4) = 9474 Input : x = 9473 Output : No Explanation : Number of digits n = 4 (9*9*9*9) + (4*4*4*4) + (7*7*7*7) + (3*3*3*3) != 9474
Below is the implementation to check if a number is plus perfect number or not.
- Check if given number is perfect square
- Check whether the number can be made perfect square after adding 1
- Check if a number is perfect square without finding square root
- Check if the sum of perfect squares in an array is divisible by x
- Check perfect square using addition/subtraction
- Program to check whether a number is Proth number or not
- Check if product of array containing prime numbers is a perfect square
- Program to check Strong Number
- Program to check if N is a Pentagonal Number
- Program to check for Peterson number
- Program to check the number is Palindrome or not
- Find minimum number to be divided to make a number a perfect square
- Number of times the largest perfect square number can be subtracted from N
- Program to check if a given number is Lucky (all digits are different)
- Program to check if a number is divisible by sum of its digits
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.
Improved By : jit_t