Hacker News new | past | comments | ask | show | jobs | submit | cscscscscsc's comments login

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!

I happened to notice the exact same thing when playing with this puzzle in Lean!

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.

[0]: https://www.ssa.gov/oact/STATS/table4c6.html


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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: