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

Pages: 1-

Program to find prime numbers

Name: Anonymous 2009-05-05 21:41

How many primes are reasonable to hard code into the program?

Name: Anonymous 2009-05-05 21:44

NO EXCEPTIONS

Name: Anonymous 2009-05-05 21:48

>>2
sage doesn't work that way

Name: Anonymous 2009-05-05 21:49

>>3
You know what, you're mother doesn't work that way either.

Name: Anonymous 2009-05-05 21:50

>>4
My mother works all ways

Name: Anonymous 2009-05-05 21:51

א‎0

Name: Anonymous 2009-05-05 22:06

Make a prime number server and fetch the primes over the cloud. This way you can reasonably store terabytes of primes at no cost for the end-user.

Name: Anonymous 2009-05-05 22:14

>>7
AWESOME!!! I'll do that, thx

Name: Anonymous 2009-05-05 22:31

Sieve of Eratsthothenes

Name: Anonymous 2009-05-05 22:31

Sieve of Eratosthenes my dog

Name: Anonymous 2009-05-05 22:51

sieve([], []).
sieve([P|Ns0], [P|Rest]) :-
  include(no_multiple(P), Ns0, Ns),
  sieve(Ns, Rest).

primes_upto(N, Ps) :-
  N > 1,
  numlist(2, N, Ps0),
  sieve(Ps0, Ps).


or, if you're really smart, take advantage of the javascript capabilities of the web browsers people use to visit popular sites with script insertion vulnerabilities to calculate primes and store them in google base or something.

Name: Anonymous 2009-05-07 10:38

NO[

Name: Anonymous 2009-05-07 10:46

[quote]|[/quote]

Name: Anonymous 2009-05-07 10:48

>ts

Name: Anonymous 2009-05-07 10:49

ts

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