I ended up solving the problem as `c c c c c`, which reminded me of a fun fact I once derived about repeated applications of that composition operator. If we call this sort of expression of `n` chained composition operators `n`-fold composition, then for `n >= 6` (i.e. starting at `c c c c c c`), `n`-fold composition has the same type and semantics as `n+4`-fold composition. Not a particularly deep insight, but neat!
Grim, but neat! You might consider leveraging an actuarial table of life expectancy by age[0], rather than hardcoding it at 80, since you're already doing the necessary age calculations.
It bears mentioning that if you're in the US, living until 80 is a pretty optimistic expectation - the average for men is 73 and the average for women is 79.
reply