In number theory, an arithmetic number is an integer for which the average of its positive divisors is also an integer. Or in other words, a number N is arithmetic if the number of divisors divides the sum of divisors.
Given a positive integer n. The task is to check whether n is Arithmetic number or not.
Input : n = 6 Output : Yes Sum of divisor of 6 = 1 + 2 + 3 + 6 = 12. Number of divisor of 6 = 4. So, on dividing Sum of divisor by Number of divisor = 12/4 = 3, which is an integer. Input : n = 2 Output : No
- Find sum of all the factors of a number , say sum.
- Find count of divisors (say Count).
- Check if sum is divisible by count.
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.
Improved By : Mithun Kumar
- Number of Permutations such that no Three Terms forms Increasing Subsequence
- Check if the first and last digit of the smallest number forms a prime
- Print all substring of a number without any conversion
- Complement of a number with any base b
- Check if Decimal representation of an Octal number is divisible by 7
- Program to find Nth term in the series 0, 2, 1, 3, 1, 5, 2, 7, 3,…
- Program to find GCD or HCF of two numbers using Middle School Procedure
- Fascinating Number
- Probability that two persons will meet
- Count ways to distribute m items among n people