- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python Program for Find minimum sum of factors of number
In this article, we will learn about the solution to the problem statement given below −
Problem statement
Given a number input , find the minimum sum of factors of the given number.
Here we will compute all the factors and their corresponding sum and then find the minimum among them.
So to find the minimum sum of the product of number, we find the sum of prime factors of the product.
Here is the iterative implementation for the problem −
Example
#iterative approach def findMinSum(num): sum_ = 0 # Find factors of number and add to the sum i = 2 while(i * i <= num): while(num % i == 0): sum_ += i num /= i i += 1 sum_ += num return sum_ # Driver Code num = 12 print (findMinSum(num))
Output
7
All the variables are declared in the global frame as shown in the figure given below −
Conclusion
In this article, we learned about the approach to Find the minimum sum of factors of a number.
- Related Articles
- Python Program for Find sum of even factors of a number
- Python Program for Find sum of odd factors of a number
- Java Program to find minimum sum of factors of a number
- C Program to Find the minimum sum of factors of a number?
- Find minimum sum of factors of number using C++.
- C Program for Find sum of odd factors of a number?
- C++ program for Find sum of odd factors of a number
- Find sum of even factors of a number in Python Program
- C++ Program to find sum of even factors of a number?
- Java Program to Find sum of even factors of a number
- To find sum of even factors of a number in C++ Program?
- Program to find equal sum arrays with minimum number of operations in Python
- Python Program for Product of unique prime factors of a number
- Program to find minimum number of rocketships needed for rescue in Python
- Find sum of even factors of a number using C++.

Advertisements