[grand-rapids-pm-list] Prime?

grand-rapids-pm-list at pm.org grand-rapids-pm-list at pm.org
Tue Oct 2 05:06:14 PDT 2007


GR.pm,

I made some tweaks to the mailing list settings and needed to send a test msg. So, here's a regex similar to one Andy presented that "counts" prime numbers. This one just indicates primality.

perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/' [number]

Explanation:
http://montreal.pm.org/tech/neil_kandalgaonkar.shtml

Ed Eddington
GR Perlmongers

** ** **  PRIVILEGED AND CONFIDENTIAL  ** ** **
This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above.  Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law.  If you are not the intended recipient or a person responsible for delivering this message to an intended recipient, please delete the email and immediately notify the sender via the email return address or mailto:postmaster at priorityhealth.com.  Thank you.

- end -



More information about the grand-rapids-pm-list mailing list