Output the Goodstein sequence
Haskell, 77 bytes



(&amp;2) is an anonymous function taking an Integer and returning a (potentially very long) list of Integers, use as (&amp;2) 13.

(&amp;2)
n&amp;b|n&lt;0=[]|let _?0=0;e?n=(e+1)?div n b+mod n b*(b+1)^0?e=n:(0?n-1)&amp;(b+1)


Try it online! (cuts off at 10^25.)

How it works


(&amp;2) starts the sequence with base 2.
n&amp;b calculates the subsequence starting with the number n and base b.


It halts with an empty list if n&lt;0, which generally happens the step after n==0.
Otherwise, it prepends n to the list returned recursively by the expression (0?n-1)&amp;(b+1).

? is a local function operator. 0?n gives the result of converting n to hereditary base b, then incrementing the base everywhere.


The conversion recurses with the variable e keeping track of the current exponent. e?n converts the number n*b^e.
The recursion halts with 0 when n==0.
Otherwise, it divides n by the base b.


(e+1)?div n b handles the recursion for the quotient and next higher exponent.
mod n b*(b+1)^0?e handles the remainder (which is the digit corresponding to the current exponent e), the increment of base, and converting the current exponent hereditarily with 0?e.