[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Prime Numbers



jwblist@olympus.net (John W Baxter) wrote:
>At 7:37 -0400 8/16/99, Bill Jones wrote:
>>I have verified that the first 1,000 are prime.
>
>That's a good start.  Are any actual primes in the range ending at the last
>one reported missing from the output?
>

One cannot verify the correctness of a prime number algorithm by comparing its
results to some known list of primes (though it can sure inspire confidence). 
The only way to verify correctness is to understand the algorithm and show that
it does in fact do the job.

I bring this up because in mathematics, most people consider it good form when
questioning the validity of someone's work to either have a counterexample or a
specific reason not to trust the work.

The regular expression /^(11+)\1+$/ will match any composite number of '1's,
because it will divide the ones into n groups of m ones.


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org