exercism/ruby/nth-prime
Ben Harris 3a6f481571 things 2018-03-09 15:13:37 -05:00
..
README.md init 2018-03-02 17:27:55 -05:00
nth_prime.rb things 2018-03-09 15:13:37 -05:00
nth_prime_test.rb init 2018-03-02 17:27:55 -05:00

README.md

Nth Prime

Given a number n, determine what the nth prime is.

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

If your language provides methods in the standard library to deal with prime numbers, pretend they don't exist and implement them yourself.


For installation and learning resources, refer to the exercism help page.

For running the tests provided, you will need the Minitest gem. Open a terminal window and run the following command to install minitest:

gem install minitest

If you would like color output, you can require 'minitest/pride' in the test file, or note the alternative instruction, below, for running the test file.

Run the tests from the exercise directory using the following command:

ruby nth_prime_test.rb

To include color from the command line:

ruby -r minitest/pride nth_prime_test.rb

Source

A variation on Problem 7 at Project Euler http://projecteuler.net/problem=7

Submitting Incomplete Solutions

It's possible to submit an incomplete solution so you can see how others have completed the exercise.