I regularly participate on the site known as HackThisSite.org, it’s a great resource and community for those interested in hacking or in the general field of computers, internet and security. Recently in the user submitted challenges section I found a simple programming challenge that I decided to try and do.
The challenge was, in any language, find the first 25 “power numbers”. These are numbers that follow a rule of “if the sum of each digit in the number raised to the power of the length of the number is the number, it is a power number”.
I added some notes on that page as well. Namely, browsers are not created equal, Firefox seems to be king of the workers.. and as you add “threads” from 0 you will get better performance up until about 20, after which, it appears to go the other way, and starts missing some numbers… that could be because of my math function to find powered numbers though.
EDIT: I fixed my math function and wowsers, super performance increase on a massive order of magnititude, I’m definitely going to have to revisit this now.