Define the Fouriest Transform of a number to be the base- representation of whose digits contain the most 's of all representations such that is minimized. If you wrote out the Fouriest Transform of all positive integers up to and including , let be the total number of 's you would count in all of their digits. What are the last three digits of ?
Details and Assumptions
As an explicit example, the Fouriest Transform of is (base-) which contains fours. Although its base- representation, , also contains fours, is the smaller base.
If there does not exists a base that can be represented in that has any fours, define the Fouriest Transform of that number to be its base- representation.
This problem was inspired by the following Saturday Morning Breakfast Cereal Cartoon.