Simple Java solution
Basic idea is to divide your number into threes unless when the last number is 4\nEg : \n\n    7 = 3 * 2 * 2\n    8 = 3 * 3 * 2\n    9 = 3 * 3 * 3\n    10 = 3 *
    Basic idea is to divide your number into threes unless when the last number is 4\nEg : \n\n    7 = 3 * 2 * 2\n    8 = 3 * 3 * 2\n    9 = 3 * 3 * 3\n    10 = 3 * 3 * 2 * 2\n    11 = 3 * 3 * 3 * 2\n    12 = 3 * 3 * 3 * 3\n    13 = 3 * 3 * 3 * 2 * 2\nSee, the pattern?\n\n   \tpublic static int integerBreak(int n) {\n\t\tif(n==2||n==3) return n-1;\n\t\tif(n==4) return 4;\n\t\tint temp = n;\n\t\tint sum = 1;\n\t\twhile(temp>4){\n\t\t\ttemp = temp -3;\n\t\t\tsum = sum*3;\n\t\t}\n\t\t\treturn sum*temp;\n\t}
[]