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 trailing zeros in Binary representation of a number using Bitset
- Count number of triplets with product equal to given number with duplicates allowed
- Find minimum number to be divided to make a number a perfect square
- Maximum number formed from array with K number of adjacent swaps allowed
- Number of possible permutations when absolute difference between number of elements to the right and left are given
- Given number of matches played, find number of teams in tournament
- Number of times the largest perfect square number can be subtracted from N
- Find the total number of composite factor for a given number
- Program to calculate the number of odd days in given number of years
- Print a number strictly less than a given number such that all its digits are distinct.
- Find count of digits in a number that divide the number
- Querying maximum number of divisors that a number in a given range has
- Program to Convert Octal Number to Binary Number
- Find the largest good number in the divisors of given number N
- Super Ugly Number (Number whose prime factors are in given set)
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