Here's my solution, made before peeking at any of the other submissions. 
  It's not too bad; generates the weird numbers up to 100,000 in about 3 
minutes on a pokey 233 Celeron.

   http://users.adelphia.net/~showaltb/rubyquiz/57/weird.rb

Now I'm off to peek at the other solutions to see how bad my algorithm is!