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:
- Find sum of divisors of all the divisors of a natural number
- Find sum of inverse of the divisors when sum of divisors and the number is given
- Find number from its divisors
- Find the number of integers x in range (1,N) for which x and x+1 have same number of divisors
- Find the largest good number in the divisors of given number N
- Find all divisors of a natural number | Set 1
- Find all divisors of a natural number | Set 2
- Find the number of divisors of all numbers in the range [1, n]
- Program to find count of numbers having odd number of divisors in given range
- Check if a number is divisible by all prime divisors of another number
- Querying maximum number of divisors that a number in a given range has
- Find A and B from list of divisors
- First triangular number whose number of divisors exceeds N
- Find largest sum of digits in all divisors of n
- Find numbers with K odd divisors in a given range
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.