Straight Forward || Easy || Reacursion|| Prime Factorization
Base case:  If n is prime it means we can not subdivide it, means it is in its minimum form hence return it.\n\nIf the sum_of_prime_factors_of_n == n then it me
Base case:  If n is prime it means we can not subdivide it, means it is in its minimum form hence return it.\n\nIf the sum_of_prime_factors_of_n == n then it means we can not reduce it so we return n otherwise it will create infinite loop.\n\n# Code\n```\nclass Solution {\n    bool isPrime(int n){\n        for(int i = 2;i * i <= n;i++){\n            if(n % i == 0)return false;\n        }\n        return true;\n    }\npublic:\n    int smallestValue(int n) {\n\n        if(isPrime(n))return n;\n\n        int x = n;\n        int sum = 0;\n        //Sum all the prime factors of n\n        for(int i = 2;i * i <= n;i++){\n            while(x % i == 0){\n                sum += i;\n                x /= i;\n            }\n        }\n        if(x > 1)sum += x;\n\n        if(sum == n)return n;\n\n        return smallestValue(sum);\n    }\n};\n```\nPlease Upvote if you found it helpfull\uD83D\uDE0A
['Recursion', 'C']