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:
- Sum of Maximum and Minimum prime factor of every number in the Array
- Find largest prime factor of a number
- k-th prime factor of a given number
- N-th prime factor of a given number
- Sum of largest prime factor of each number less than equal to n
- Find prime number K in an array such that (A[i] % K) is maximum
- Find the total number of composite factor for a given number
- Prime Factor
- Find coordinates of a prime number in a Prime Spiral
- Least prime factor of numbers till n
- Exactly n distinct prime factor numbers from a to b
- Nearest element with at-least one common prime factor
- Queries on the sum of prime factor counts in a range
- Count all the numbers less than 10^6 whose minimum prime factor is N
- Number with maximum number of prime factors
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.