In number theory, the aliquot sum s(n) of a positive integer n is the sum of all proper divisors of n, that is, all divisors of n other than n itself.
They are defined by the sums of their aliquot divisors. The aliquot divisors of a number are all of its divisors except the number itself. The aliquot sum is the sum of the aliquot divisors so, for example, the aliquot divisors of 12 are 1, 2, 3, 4, and 6 and it’s aliquot sum is 16.
A number whose aliquot sum equals its value is a PERFECT number (6 for example).
Input : 12 Output : 16 Explanation : Proper divisors of 12 is = 1, 2, 3, 4, 6 and sum 1 + 2 + 3 + 4 + 6 = 16 Input : 15 Output : 9 Explanation : Proper divisors of 15 is 1, 3, 5 and sum 1 + 3 + 5 = 9
A simple solution is to traverse through all numbers smaller than n. For every number i, check if i divides n. If yes, we add it to result.
- Aliquot Sequence
- Find Kth smallest value for b such that a + b = a | b
- Number of pairs of lines having integer intersection points
- Percentage change in Hemisphere volume if radius is changed
- Program to find the time remaining for the day to complete
- Find two numbers with the given LCM and minimum possible difference
- Find an integer that is common in the maximum number of given arithmetic progressions
- How is the time complexity of Sieve of Eratosthenes is n*log(log(n))?
- Number of trailing zeros in N * (N - 2) * (N - 4)*....
- Height of Pyramid formed with given Rectangular Box
- Make all the array elements odd with minimum operations of given type
- Divide N into K unique parts such that gcd of those parts is maximum
- Find Number of Even cells in a Zero Matrix after Q queries
- Maximize the number of palindromic Strings
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.
Improved By : jit_t