Skip to main content
Post Closed as "Needs details or clarity" by user202729, Wheat Wizard, Xcali, Chris, Toto
Notice removed Canonical answer required by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Canonical answer required by noɥʇʎԀʎzɐɹƆ
Bounty Started worth 150 reputation by noɥʇʎԀʎzɐɹƆ
edited tags
Link
user45941
user45941
Tweeted twitter.com/#!/StackCodeGolf/status/212719729549381634

Rules are simple (Edit: they were supposed to be)-

  • First nn primes (not primes below n), should be printed to standard output separated by newlines (primes should be generated within the code)

  • primes cannot be generated by an inbuilt function or through a library or through a library, i.e. use of a inbuilt or library function such as, prime = get_nth_prime(n), is_a_prime(number), or factorlist = list_all_factors(number) won't be very creative.

  • Scoring - Say, we define Score = f([number of chars in the code]), O(f(n)) being the complexity of your algorithm where n is the number of primes it finds. So for example, if you have a 300 char code with O(n^2) complexity, score is 300^2 = 90000, for 300 chars with O(nln(n)), score becomes 3005.7 = 1711.13 (let's assume all logs to be natural logs for simplicity)

  • Use any existing programming language, lowest score wins

Edit: Problem has been changed from finding 'first 1000000 primes' to 'first n primes' because of a confusion about what 'n' in O(f(n)) is, n is the number of primes you find (finding primes is the problem here and so complexity of the problem depends on the number of primes found)

Note: to clarify some confusions on complexity, if 'n' is the number of primes you find and 'N' is the nth prime found, complexity in terms of n is and N are not equivalent i.e. O(f(n)) != O(f(N)) as , f(N) != constant * f(n) and N != constant * n, because we know that nth prime function is not linear, I though since we were finding 'n' primes complexity should be easily expressible in terms of 'n'.

As pointed out by Kibbee, you can visit this site to verify your solutions (here, is the old google docs list)

Please Include these in your solution -

  • what complexity your program has (include basic analysis if not trivial)

  • character length of code

  • the final calculated score

This is my first CodeGolf Question so, if there is a mistake or loophole in above rules please do point them out.

Rules are simple (Edit: they were supposed to be)-

  • First n primes (not primes below n), should be printed to standard output separated by newlines (primes should be generated within the code)

  • primes cannot be generated by an inbuilt function or through a library, i.e. use of a inbuilt or library function such as, prime = get_nth_prime(n), is_a_prime(number), or factorlist = list_all_factors(number) won't be very creative.

  • Scoring - Say, we define Score = f([number of chars in the code]), O(f(n)) being the complexity of your algorithm where n is the number of primes it finds. So for example, if you have a 300 char code with O(n^2) complexity, score is 300^2 = 90000, for 300 chars with O(nln(n)), score becomes 3005.7 = 1711.13 (let's assume all logs to be natural logs for simplicity)

  • Use any existing programming language, lowest score wins

Edit: Problem has been changed from finding 'first 1000000 primes' to 'first n primes' because of a confusion about what 'n' in O(f(n)) is, n is the number of primes you find (finding primes is the problem here and so complexity of the problem depends on the number of primes found)

Note: to clarify some confusions on complexity, if 'n' is the number of primes you find and 'N' is the nth prime found, complexity in terms of n is and N are not equivalent i.e. O(f(n)) != O(f(N)) as , f(N) != constant * f(n) and N != constant * n, because we know that nth prime function is not linear, I though since we were finding 'n' primes complexity should be easily expressible in terms of 'n'.

As pointed out by Kibbee, you can visit this site to verify your solutions (here, is the old google docs list)

Please Include these in your solution -

  • what complexity your program has (include basic analysis if not trivial)

  • character length of code

  • the final calculated score

This is my first CodeGolf Question so, if there is a mistake or loophole in above rules please do point them out.

Rules are simple:

  • First n primes (not primes below n), should be printed to standard output separated by newlines (primes should be generated within the code)

  • primes cannot be generated by an inbuilt function or through a library, i.e. use of a inbuilt or library function such as, prime = get_nth_prime(n), is_a_prime(number), or factorlist = list_all_factors(number) won't be very creative.

  • Scoring - Say, we define Score = f([number of chars in the code]), O(f(n)) being the complexity of your algorithm where n is the number of primes it finds. So for example, if you have a 300 char code with O(n^2) complexity, score is 300^2 = 90000, for 300 chars with O(nln(n)), score becomes 3005.7 = 1711.13 (let's assume all logs to be natural logs for simplicity)

  • Use any existing programming language, lowest score wins

Edit: Problem has been changed from finding 'first 1000000 primes' to 'first n primes' because of a confusion about what 'n' in O(f(n)) is, n is the number of primes you find (finding primes is the problem here and so complexity of the problem depends on the number of primes found)

Note: to clarify some confusions on complexity, if 'n' is the number of primes you find and 'N' is the nth prime found, complexity in terms of n is and N are not equivalent i.e. O(f(n)) != O(f(N)) as , f(N) != constant * f(n) and N != constant * n, because we know that nth prime function is not linear, I though since we were finding 'n' primes complexity should be easily expressible in terms of 'n'.

As pointed out by Kibbee, you can visit this site to verify your solutions (here, is the old google docs list)

Please Include these in your solution -

  • what complexity your program has (include basic analysis if not trivial)

  • character length of code

  • the final calculated score

This is my first CodeGolf Question so, if there is a mistake or loophole in above rules please do point them out.

added 312 characters in body; edited title
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9

Rules are simple (Edit: they were supposed to be)-

  • First n primes (not primes below n), should be printed to standard output separated by newlines (primes should be generated within the code)

  • primes cannot be generated by an inbuilt function or through a library, i.e. use of a inbuilt or library function such as, prime = get_nth_prime(n), is_a_prime(number), or factorlist = list_all_factors(number) won't be very creative.

  • Scoring - Say, we define Score = f([number of chars in the code]), O(f(n)) being the complexity of your algorithm where n is the number of primes it finds. So for example, if you have a 300 char code with O(n^2) complexity, score is 300^2 = 90000, for 300 chars with O(nln(n)), score becomes 3005.7 = 1711.13 (let's assume all logs to be natural logs for simplicity)

  • Use any existing programming language, lowest score wins

Edit: Problem has been changed from finding 'first 1000000 primes' to 'first n primes' because of a confusion about what 'n' in O(f(n)) is, n is the number of primes you find (finding primes is the problem here and so complexity of the problem depends on the number of primes found)

Note: to clarify some confusions on complexity, if 'n' is the number of primes you find and 'N' is the nth prime found, complexity in terms of n is and N are not equivalent i.e. O(f(n)) != O(f(N)) as , f(N) != constant * f(n) and N != constant * n, because we know that nth prime function is not constantlinear, I though since we were finding 'n' primes complexity should be easily expressible in terms of 'n'.

ToAs pointed out by Kibbee, you can visit this site to verify your solutions, a list of million primes is available (here, (it's onis the old google docs, pastebin won't let me upload an 8 Mb file without paying list)

Please Include these in your solution -

  • what complexity your program has (include basic analysis if not trivial)

  • character length of code

  • the final calculated score

This is my first CodeGolf Question so, if there is a mistake or loophole in above rules please do point them out.

Rules are simple (Edit: they were supposed to be)-

  • First n primes (not primes below n), should be printed to standard output separated by newlines (primes should be generated within the code)

  • primes cannot be generated by an inbuilt function or through a library, i.e. use of a inbuilt or library function such as, prime = get_nth_prime(n), is_a_prime(number), or factorlist = list_all_factors(number) won't be very creative.

  • Scoring - Say, we define Score = f([number of chars in the code]), O(f(n)) being the complexity of your algorithm where n is the number of primes it finds. So for example, if you have a 300 char code with O(n^2) complexity, score is 300^2 = 90000, for 300 chars with O(nln(n)), score becomes 3005.7 = 1711.13 (let's assume all logs to be natural logs for simplicity)

  • Use any existing programming language, lowest score wins

Edit: Problem has been changed from finding 'first 1000000 primes' to 'first n primes' because of a confusion about what 'n' in O(f(n)) is, n is the number of primes you find (finding primes is the problem here and so complexity of the problem depends on the number of primes found)

Note: to clarify some confusions on complexity, if 'n' is the number of primes you find and 'N' is the nth prime found, complexity in terms of n is and N are not equivalent i.e. O(f(n)) != O(f(N)) as , f(N) != constant * f(n) and N != constant * n, because we know that nth prime function is not constant, I though since we were finding 'n' primes complexity should be easily expressible in terms of 'n'.

To verify your solutions, a list of million primes is available here, (it's on google docs, pastebin won't let me upload an 8 Mb file without paying)

Please Include these in your solution -

  • what complexity your program has (include basic analysis if not trivial)

  • character length of code

  • the final calculated score

This is my first CodeGolf Question so, if there is a mistake or loophole in above rules please do point them out.

Rules are simple (Edit: they were supposed to be)-

  • First n primes (not primes below n), should be printed to standard output separated by newlines (primes should be generated within the code)

  • primes cannot be generated by an inbuilt function or through a library, i.e. use of a inbuilt or library function such as, prime = get_nth_prime(n), is_a_prime(number), or factorlist = list_all_factors(number) won't be very creative.

  • Scoring - Say, we define Score = f([number of chars in the code]), O(f(n)) being the complexity of your algorithm where n is the number of primes it finds. So for example, if you have a 300 char code with O(n^2) complexity, score is 300^2 = 90000, for 300 chars with O(nln(n)), score becomes 3005.7 = 1711.13 (let's assume all logs to be natural logs for simplicity)

  • Use any existing programming language, lowest score wins

Edit: Problem has been changed from finding 'first 1000000 primes' to 'first n primes' because of a confusion about what 'n' in O(f(n)) is, n is the number of primes you find (finding primes is the problem here and so complexity of the problem depends on the number of primes found)

Note: to clarify some confusions on complexity, if 'n' is the number of primes you find and 'N' is the nth prime found, complexity in terms of n is and N are not equivalent i.e. O(f(n)) != O(f(N)) as , f(N) != constant * f(n) and N != constant * n, because we know that nth prime function is not linear, I though since we were finding 'n' primes complexity should be easily expressible in terms of 'n'.

As pointed out by Kibbee, you can visit this site to verify your solutions (here, is the old google docs list)

Please Include these in your solution -

  • what complexity your program has (include basic analysis if not trivial)

  • character length of code

  • the final calculated score

This is my first CodeGolf Question so, if there is a mistake or loophole in above rules please do point them out.

added 312 characters in body; edited title
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 413 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 55 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 1 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 48 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 17 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 70 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 34 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 24 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 178 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
added 18 characters in body
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading
Source Link
Optimus
  • 549
  • 1
  • 4
  • 9
Loading