← RoseCode

ROSECODE 555

A Simpler Goodstein Sequence

Philippe_57721 · Math ·

Given a positive integer n, let the following process:
1) We start with base 2
2) Express n in the current base
3) Increment the base by 1
4) Take the number n in this new base and decrement it by 1
5) Go to step 2 until n=0.

Here an example for n=4
Step Number Base Digits Comments
1 4 2 1,0,0
2 8 3 2,2 8 = 1.3^3 + 0.3^1 + 0 - 1
3 9 4 2,1 9 = 2.4^1 + 2 - 1
4 10 5 2,0
5 11 6 1,5
6 11 7 1,4
7 11 8 1,3
8 11 9 1,2
9 11 10 1,1
10 11 11 1,0
11 11 12 11
12 10 13 10
13 9 14 9
14 8 15 8
15 7 16 7
16 6 17 6
17 5 18 5
18 4 19 4
19 3 20 3
20 2 21 2
21 1 22 1
22 0 23 Done!

We reach the value 0 in 22 steps. Let write G(4)=22

What is G(1024)?
Give your answer modulo 1000000007

PS:
This is a variant of Problem 396.