Java || Brute force
\nclass Solution {\n    public int smallestValue(int n) {\n        int check = n;\n        while (isPrime(check) != 1) {\n            int curr = getValue(check)
```\nclass Solution {\n    public int smallestValue(int n) {\n        int check = n;\n        while (isPrime(check) != 1) {\n            int curr = getValue(check);\n            if (curr == check) {\n                return check;\n            }\n            check = curr;\n        }\n        return check;\n    }\n    public int getValue(int n) {\n        int res = 0;\n        int check = n;\n        for (int i = 2; i <= n; i++) {\n            if (isPrime(i) == 1) {\n                while (check % i == 0) {\n                    res += i;\n                    check /= i;\n                }\n            }\n        }\n        return res;\n    }\n    public int isPrime(int n) {\n        for (int i = 2; i <= Math.sqrt(n); i++) {\n            while (n % i == 0) {\n                return i;\n            }\n        }\n        return 1;\n    }\n}\n```
['Java']