Given an integer N, the task is to find the sum of N and it’s maximum prime factor.
Maximum prime factor of 19 is 19.
Hence, 19 + 19 = 38
8 + 2 = 10
Approach: Find the largest prime factor of the number and store it in maxPrimeFact then print the value of N + maxPrimeFact.
Below is the implementation of the above approach:
- Numbers with sum of digits equal to the sum of digits of its all prime factor
- Sum of Maximum and Minimum prime factor of every number in the Array
- Sum of largest prime factor of each number less than equal to n
- Find largest prime factor of a number
- Queries on the sum of prime factor counts in a range
- k-th prime factor of a given number
- N-th prime factor of a given number
- Find N numbers such that a number and its reverse are divisible by sum of its digits
- Exactly n distinct prime factor numbers from a to b
- Nearest element with at-least one common prime factor
- Count all the numbers less than 10^6 whose minimum prime factor is N
- Prime Factor
- Count of distinct power of prime factor of N
- Least prime factor of numbers till n
- Find the total number of composite factor for a given number
- Maximum length subsequence such that adjacent elements in the subsequence have a common factor
- Check if a prime number can be expressed as sum of two Prime Numbers
- Program to find HCF (Highest Common Factor) of 2 Numbers
- Find largest factor of N such that N/F is less than K
- Find coordinates of a prime number in a Prime Spiral
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.