Factor Fusion
Given an integer n, return the sum of all of its unique factors.
Input
Your first line will contain an integer n.
Output
The sum of all unique factors of n.
Constraints
For all test cases:
- 1≤n≤107
Example 1
10
18
Explanation
The factors of 10 are 1,2,5,10. The sum of these factors is 18.
Example 2
4
7
Explanation
The factors of 4 are 1,2,4. The sum of these factors is 7.
Python Template
n = int(input())
Comments0
No comments yet
Be the first to comment.
New comment
Log in to join the discussion.