Deserium Number: A number is said to be Deserium number if the sum of the digits of a number with respect to the power of from 1 to the number of digits is equal to the number itself is known as Deserium Number.
Input : 135 Output : Yes 1^1 + 3^2 + 5^3 = 135 Input : 9 Output : Yes 9^1 = 9 Input : 125 Output : No 1^1+2^2+5^3 != 125
The idea is simple.
1) Count digits in given number.
2) Traverse from rightmost digit to leftmost and compute sum of powers.
3) If sum of powers is equal to given number, return true.
- Count number of triplets with product equal to given number with duplicates allowed
- Maximum number formed from array with K number of adjacent swaps allowed
- Count number of trailing zeros in Binary representation of a number using Bitset
- Find minimum number to be divided to make a number a perfect square
- Given number of matches played, find number of teams in tournament
- Number of possible permutations when absolute difference between number of elements to the right and left are given
- Find smallest possible Number from a given large Number with same count of digits
- Largest number dividing maximum number of elements in the array
- Smallest number dividing minimum number of elements in the array | Set 2
- Smallest number dividing minimum number of elements in the Array
- Find the number of positive integers less than or equal to N that have an odd number of digits
- Number of times the largest perfect square number can be subtracted from N
- Minimum divisor of a number to make the number perfect cube
- Number of ways to split a binary number such that every part is divisible by 2
- Find the number of jumps to reach X in the number line from zero
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