Given three integers A, B, C, the task is to find
ΣAi=1ΣBj=1ΣCk=1 d(i.j.k), where d(x) is the number of divisors of x. Answer can be very large, So, print answer modulo 109+7.
Input: A = 2, B = 2, c = 2 Output: 20 Explanation: d(1.1.1) = d(1) = 1; d(1·1·2) = d(2) = 2; d(1·2·1) = d(2) = 2; d(1·2·2) = d(4) = 3; d(2·1·1) = d(2) = 2; d(2·1·2) = d(4) = 3; d(2·2·1) = d(4) = 3; d(2·2·2) = d(8) = 4. Input: A = 5, B = 6, C = 7 Output: 1520
- Find the number of divisors of all numbers in the range [1, N]
- Run three nested loops with iterators i, j, k staring from 1 to N
- Then find d(i.j.k) using pre computed number of divisors.
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.
- Find sum of inverse of the divisors when sum of divisors and the number is given
- Find sum of divisors of all the divisors of a natural number
- Check if a number has an odd count of odd divisors and even count of even divisors
- Divisors of n-square that are not divisors of n
- Maximum possible prime divisors that can exist in numbers having exactly N divisors
- Check if count of even divisors of N is equal to count of odd divisors
- Find the largest good number in the divisors of given number N
- Find the number of integers x in range (1,N) for which x and x+1 have same number of divisors
- Find largest sum of digits in all divisors of n
- Sum of all proper divisors of a natural number
- Sum of divisors of factorial of a number
- Sum of all the prime divisors of a number
- Break a number such that sum of maximum divisors of all parts is minimum
- Sum of multiplication of triplet of divisors of a number
- Sum of all second largest divisors after splitting a number into one or more parts
- Count all pairs of divisors of a number N whose sum is coprime with N
- Find all divisors of a natural number | Set 1
- Find all divisors of a natural number | Set 2
- Program to find count of numbers having odd number of divisors in given range
- Find the number of divisors of all numbers in the range [1, n]
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.