06  coding dojo

That's a pretty complicated formula to come up with on your own... Great job hunting down the answer, but be sure to document where it came from. Also, I haven't seen this in anyone else's code. You might be missing an opportunity to distribute some knowledge about the problem.