Easy python solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n --->   61 ms\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n \n# Code\n```\nclass Solution:\n    def smallestValue(self, n: int) -> int:\n        def pr(n):\n            x=[]\n            while n % 2 == 0:\n                x.append(2)\n                n = n / 2\n            for i in range(3,int(math.sqrt(n))+1,2):\n                while n % i== 0:\n                    x.append(i)\n                    n = n / i\n            if n > 2:\n                x.append(n)\n            return sum(x)\n        while(n!=pr(n)):\n            n=pr(n)\n        return int(n)            \n              \n```
['Python3']