1 2 3 4 5 6 7 8 9 10 11
int additive_helper(int n, int count) { if(n<9) { return count; } else { return additive_helper(sum(digit(n)), count + 1); } } int additive(int n) { return additive_helper(n, 0); }