Just out of curiousity, what is the basic test case for this? I only ask because an algorithm to generate 9-digit numbers that don't begin with 7, 8, or 9 sounds awfully useful to generate bogus US Social Security Numbers. I don't want to sound paranoid or anything; it just struct me as an odd coincidence... -rcoder