Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
OK thanks hencethus! I'll certainly keep that in mind for future katas
This comment is hidden because it contains spoiler information about the solution
Rayning and anhkind, for some reason I can't use the 'reply' function. Most of the solutions posted so far don't hard-code in an upper bound. Even one sieve solution generates an upper bound using the prime number theorem.
Why do you think it should be specified ahead of time?
I'm rayning3 on Skype, if you want to talk. If you have any questions about Ruby, I've been programming in it for over 1 year now. My email is rayning@gmail.com. I'm happy to help! What's your new job? Congratulations.
Ok thanks rayning for clearing that up with me. I'm very green to Ruby so I'm still trying to get a grasp on how things work with the language (Learning it for my new job I recently was hired to). I wasn't aware gems were foul game as I just recently learned about them (job uses many of them) but I definitely understand where you were getting at. The question itself didn't say anything about not being able to use them but I will keep that in mind for the future. Thanks again! I will try to come up with another solution
C'mon, Kasare12. You shouldn't use a gem (someone else's code) to make primes. Figure out an algorithm to create your own. If you are using a gem, you can't modify the code internally. Also, this problem goes up to a big number, on purpose. The basic brute force way of finding primes won't work. You need to find a faster, more efficient way. Project Euler (https://projecteuler.net/) does the same thing. They always ask you to find something that may be simple if done for a small case. But then you must solve it for a 100 digit number (or more). Brute force usually won't work.
This comment is hidden because it contains spoiler information about the solution
Sure, Kasare12. How may I see your code to check it?
I think I have found a correct solution for this kata. It works in irb but doesn't work when I try to run it on here...Was wondering if there was someone that could verify my code to point out something I'm overlooking