Flexible digit sum
Problem 637
Given any positive integer , we can construct a new integer by inserting plus signs between some of the digits of the base representation of , and then carrying out the additions.
For example, from ( in base 10) we can construct the four base 10 integers , , and
Let be the smallest number of steps needed to arrive at a single-digit number in base . For example, and .
Let be the sum of the positive integers not exceeding such that .
You are given .
Find