simple java prime factorization
\nclass Solution {\n    public int smallestValue(int n) {\n        int sum=n;\n        while(true){\n            int sum1=0;\n            int c=2;\n            
```\nclass Solution {\n    public int smallestValue(int n) {\n        int sum=n;\n        while(true){\n            int sum1=0;\n            int c=2;\n            //for prime factors\n            while(n>1){\n                \n                if(n%c==0){\n                    sum1+=c;\n                    n=n/c;\n                }\n                else c++;\n            }\n            n=sum1;\n            // no more less sum can encounter\n            if(sum==sum1)break;\n            else sum=sum1;\n        }\n        return sum;\n    }\n}\n```
['Math', 'Greedy', 'Java']