Given an integer N, our task is the determine if the integer N is Peculiar Number. If it is then print “yes” otherwise output “no”.
The peculiar number is the number which is three times the sum of digits of the number.
Input: N = 27
Digit sum for 27 is 9 and 3 * 9 = 27 which is equal to N. Hence the output is yes.
Input: N = 36
Digit sum for 36 is 9 and 3 * 9 = 27 which is not equal to N. Hence the output is no.
To solve the problem mentioned above we have to first find the sum of the digits of a number N. Then check if the sum of digits of the number multiplied by 3 is actually the number N itself. If it is then print Yes otherwise the output is no.
Below is the implementation of the above approach:
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 a given number is a Hyperperfect Number
- Find whether a given integer is a power of 3 or not
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Determine the number of squares of unit area that a given line will pass through.
- 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
- Digital Root (repeated digital sum) of square of an integer using Digital root of the given integer
- Program to determine the Quadrant of a Complex number
- 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
- Check whether the binary equivalent of a number ends with given string or not
- Find whether a given number is a power of 4 or not
- Check Whether a number is Duck Number or not
- Program to check whether a number is Proth number or not
- Minimum decrements to make integer A divisible by integer B
- Program to determine the quadrant of the cartesian plane
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 Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.