From: Dave Bass Date: 2008-07-19T02:25:30+09:00 Subject: Re: The next number that is not in an array Some of these answers are ludicrously incomprehensible! For goodness' sake, pity the poor b*gger who has to maintain your code. (It might even be you.) Eric has shown how to do it. Put the restricted numbers in a Set or Hash. It's easy to test for membership as you increment through the numbers. Dave -- Posted via http://www.ruby-forum.com/.