A neon number is a number where the sum of digits of square of the number is equal to the number. The task is to check and print neon numbers in a range.
Input : 9 Output : Neon Number Explanation: square is 9*9 = 81 and sum of the digits of the square is 9. Input :12 Output : Not a Neon Number Explanation: square is 12*12 = 144 and sum of the digits of the square is 9 (1 + 4 + 4) which is not equal to 12.
The implementation is simple, we first compute square of given number, the find sum of digits in the square.
This article is contributed by Nikita Tiwari. 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 write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Count number of triplets with product equal to given number with duplicates 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
- Number of ways to split a binary number such that every part is divisible by 2
- Find the number of positive integers less than or equal to N that have an odd number 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
- 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 number of integers x in range (1,N) for which x and x+1 have same number of divisors
- Super Ugly Number (Number whose prime factors are in given set)
- Program to calculate the number of odd days in given number of years
- Count the number of operations required to reduce the given number
Improved By : Sam007