/^1?$|^(11+?)\1+$/

What does this regular expression do ? See it in action in the following snippet …

for ($n=1;$n<=100;$n++)
{if ((1 x $n) !~ /^1?$|^(11+?)\1+$/)
{print "$n\t";}}