in reply to Re: Prime number generator
in thread Prime number generator

..and even 57:
$o=1;{++$o&&grep!($o%$_),keys%_ or$_{$o}=print$o.$/;redo}

     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print

Replies are listed 'Best First'.
Re^3: Prime number generator
by liverpole (Monsignor) on Jul 17, 2006 at 20:04 UTC
    Very slick! ++

    It looks even nicer, I think, without whitespace, though I can't find a way to improve on your 57 ... yet! ...

    $o=1;{$_{$o}=print$o.$/if++$o&&!grep!($o%$_),keys%_;redo}

    Update:  Aha!  It took me some thinking, but here's 56 ...

    $o=1;{$_{$o}=print$o.$/if++$o,!grep!($o%$_),keys%_;redo}

    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
      And this is 54 :)
      $o=1;{print$_[0+@_]=$o.$/if++$o,!grep!($o%$_),@_;redo}

           s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print
        Amazing! ++

        Of course, you can even make it 52 with a minor change ...

        $o=1;{print$_[@_]=$o.$"if++$o,!grep!($o%$_),@_;redo}

        s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/