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.
A programmer would solve this in 1mn googling if he doesn't already know the maths solution. There's zero practice here. 1mn googling, 7kyu level coding.
Besides, I'm not planning to become a programmer, I just want to practice the languages I'll use later and learn things about them in process. Does your comment mean that I shouldn't be on the site because it's only targetted at people who want to become programmers?
Not a programming problem but a math problem.
While not uninteresting it itself, most people go to codewars to practice programming, not number theory. The problem isn't bad, it's just not suited for here.
I have not tried to solve it with loops and stuff, but given how the problem was phrased I suspect that there was a check for efficiency, which can only be passed by solving / googling the math problem but represent zero coding difficulty.
Edit: I'm not a hater, I solved it quite fast. I'm just objective.
I'm not sure about 6kyu for an O(f(n)) check is appropriate.
The vectorized solutions in R aren't fast enough, or take up too much memory. This may be suitable for slightly higher difficulty, but 6kyu should still be baby steps imo.
Instructions incorrect. We are not expected to output a stream of primes but a stream of primes IN ORDER, without skips.
So for example we can't use some formulas to generate numbers that have high chance of being primes to reduce the number of checks on each number, since they would typically miss some primes in the sequence.
As long as there exist one valid combination, then the grid is valid.