What could possibly be going here?
In the meantime, check out Stale's PowerShell version here
Andrew Morpeth also has a neat script over here
Otherwise, I have a quick and nasty script for calculating number blocks from a list of numbers on my blog

UcMadScientist.com