Base Jumping

Consider a positive integer NN written in base bb. A sequence is generated from this number by finding the largest digit dd in the expansion of NN and writing NN in base d+1,d+1, repeating until the base the number is written in can be decreased no further. For example, the sequence generated by 34610346_{10} in base 1616 has length 66: 15A16=29511=34610=10037=111224=110211315A_{16} = 295_{11} = 346_{10} = 1003_7 = 11122_4 = 110211_3. Note that the next term in the sequence would be in base 33 again, which is invalid since the base does not decrease.

There exists a single N<10000N<10000 and b<100b<100 that generates a sequence with maximal length. Find N+b.N+b.

×

Problem Loading...

Note Loading...

Set Loading...