✅ Easy  and simple || recursive || C++
\n\nclass Solution {\npublic:\n    int f(int n)\n{\n    int sm=0;\n    while (n % 2 == 0)\n    {\n        // cout << 2 << " ";\n        sm+=2;\n        n = n/2;
\n```\nclass Solution {\npublic:\n    int f(int n)\n{\n    int sm=0;\n    while (n % 2 == 0)\n    {\n        // cout << 2 << " ";\n        sm+=2;\n        n = n/2;\n    }\n \n   \n    for (int i = 3; i <= sqrt(n); i = i + 2)\n    {\n         \n        while (n % i == 0)\n        {\n            // cout << i << " ";\n            sm+=i;\n            n = n/i;\n        }\n    }\n \n    \n    if (n > 2)\n        // cout << n << " ";\n        sm+=n;\n        \n        \n        return sm;\n}\n    int smallestValue(int n) {\n        int ans=f(n);\n        if(ans==n) return ans;\n        else return smallestValue(ans);\n        \n    }\n};\n```
['C++']