Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

(´∀`) Prime numbers (,,゚Д゚)

Name: Anonymous 2007-04-15 11:11 ID:00E9fssW

|code]isPrime x = (filter (0 ==) (map (mod x) [2..x-1])) == [][/code]

Name: Anonymous 2007-04-15 11:56 ID:Heaven

sub factor{my@f,$n=pop;map{$n/=$_,push@f,$_ until$n%$_}2..$n/2;@f}
sub is_prime{!factor pop}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List