c++ beginer friendly || easy solution||simplified
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```\nclass Solution {\npublic:\n    int smallestValue(int n) {\n        int num=n;\n        n=prime(n);\n       \n        while(num!=n)\n        {\n            num=n;       \n            n=prime(n);\n            \n        }\n        return num;\n    }   \n    int prime(int n)\n    {\n        int a=n;\n    int ans =0;\n    for(int i=2;i<a;++i)\n    {\n        while(n%i==0)\n        {\n            ans+=i;\n            n/=i;\n        }\n    }\n    if(ans==0)\n        return a;\n    else return ans ;\n}\n};\n\n```
['Math', 'Recursion', 'C++']