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:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Program to determine the Quadrant of a Complex number
- Determine whether a given number is a Hyperperfect Number
- Determine the number of squares of unit area that a given line will pass through.
- Find the largest number smaller than integer N with maximum number of set bits
- Number of pairs of lines having integer intersection points
- Minimum positive integer to divide a number such that the result is an odd
- Minimum decrements to make integer A divisible by integer B
- Find an integer that is common in the maximum number of given arithmetic progressions
- Program to determine the quadrant of the cartesian plane
- Program to determine the octant of the axial plane
- Determine the count of Leaf nodes in an N-ary tree
- Minimum number of operations to convert array A to array B by adding an integer into a subarray
- Determine the position of the third person on regular N sided polygon
- Program to determine focal length of a spherical mirror
- Blum Integer
- Greatest Integer Function
- Square root of an integer
- Minimum positive integer value possible of X for given A and B in X = P*A + Q*B
- Replace all ‘0’ with ‘5’ in an input Integer
- Smallest integer which has n factors or more
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.