Hi, thank you for your contribution!
One question, should we consider the situation that multiple Ctrl-A being used, that means the 'A' typed will be increased in square. At least, the mathematics proof is needed to show that it is never this case could generate the maximum number of 'A', Thank you!

This is a really nice proof to stop the inner loop at j = 6.
Although the solution is not as fancy as those who only consider j = 4,5 but you got the mathematically convincing solution.
Thanks a lot.