You are given a positive integer n.
Repeatedly replace n with the sum of its prime factors. Continue this replacement process until the value of n stops changing.
Return the smallest value that n takes on throughout this process.
Note: If a prime factor divides
nmultiple times, it must be included in the sum as many times as it dividesn.
Constraints:
n
You are given a positive integer n.
Repeatedly replace n with the sum of its prime factors. Continue this replacement process until the value of n stops changing.
Return the smallest value that n takes on throughout this process.
Note: If a prime factor divides
nmultiple times, it must be included in the sum as many times as it dividesn.
Constraints:
n