Geeksforgeeks

Error

Given a number **N**, find the even factor sum of the number N.

**Example 1:**

**Input: **
N = 30
**Output: **
48
**Explanation:**
Even dividers sum 2 + 6 + 10 + 30 = 48

**Example 2:**

**Input: **
N = 18
**Output: **
26
**Explanation:**
Even dividers sum 2 + 6 + 18 = 26

**Your Task:**

You don't need to read input or print anything. Your task is to complete the function **evenFactors()** which takes an integer **N** as input parameters and returns an integer, number of even factors of N.

**Expected Time Complexity:** O(sqrt(N))

**Expected Space Complexity:** O(1)

**Constraints:**

1 <= N <= 10^{9}

We are replacing the old Disqus forum with the new Discussions section given below.

Click here to view old Disqus comments.

Click here to view old Disqus comments.

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

YesLoading...

Find sum of even factors of a number

...