Beats 100%
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\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int smallestValue(int n) {\n        while (true) {\n            int sum = 0, original_n = n;\n            for (int i = 2; i * i <= n; ++i) {\n                while (n % i == 0) {\n                    sum += i;\n                    n /= i;\n                }\n            }\n            if (n > 1) sum += n; \n            if (sum == original_n) return sum; \n            n = sum;\n        }\n    }\n};\n\n```
['C++']