in reply to Stamp puzzle solution
I should clarify this solution prints achievable amounts, with the breakdown of how it's achievable, one per line, and non-achievable numbers as !number, one per line, so to answer the original question:
perl elbonian.pl | grep ^! | head -1