Hacker News new | ask | show | jobs
by johndough 11 hours ago
Another approach that often works for these kinds of problems and does not require much intelligence:

Work out the first few cases by hand (1,2,6,20 in our case) and then look up the sequence on "The On-Line Encyclopedia of Integer Sequences" (OEIS):

https://oeis.org/search?q=1%2C2%2C6%2C20&language=english&go...