You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Problem in GeeksForGeeks: https://practice.geeksforgeeks.org/problems/sum-of-all-divisors-from-1-to-n4738/1
5
+
*
6
+
* Given a positive integer N., The task is to find the value of F(i) where function F(i) for the number i be defined as the sum of all divisors of ‘i‘.
7
+
*
8
+
* Example 1:
9
+
* Input: n = 4
10
+
* Output: 15
11
+
*
12
+
* Example 2:
13
+
* Input: n = 5
14
+
* Output: 21
15
+
*/
16
+
17
+
publicclassSumOfAllDivisors {
18
+
publicstaticvoidmain(String[] args) {
19
+
intn = 4;
20
+
21
+
System.out.println("Divisors sum is: " + findSumOfAllDivisors(n));
0 commit comments