Also, here's a classic, which is extra fun because it's fairly easy to pick apart and understand:
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'
It lists prime numbers.