5 kyu
Prime Sextuplets
215 of 427raulbc777
Loading description...
Algorithms
Mathematics
Sorting
Data Structures
Memoization
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
I have never seen so many cheating solutions in Kata.
Thanks to author for the great Kata!!!
Great kata to learn something new.
Locally, my tests run in under 180ms. When using the 'Test' button, it takes about 300ms. Unfortunately, upon submission, I encounter an 'Execution Timed Out (12000ms)' error.
Hi! I got this test result for sumLimit 600. expected [ 89, 97, 101, 103, 107, 109 ] to deeply equal [ 97, 101, 103, 107, 109, 113 ] I think that the first array is the solution since its sum 606. Is the test case wrong?
It's not an issue. Your solution will not fulfil the condition
[p, p + 4, p + 6, p + 10, p + 12, p + 16]
Sorry, I have misunderstood the problem. I solved it now. Thanks!
python new test framework is required + Python 3.11v. updated in this fork
Approved!
frustating kata, just did it, dont like the way i did, but many follwed simillar path,
I got this error for sum_limit=2000000:
[402757, 402761, 402763, 402767, 402769] should equal [1091257, 1091261, 1091263, 1091267, 1091269, 1091273]
Shouldn't the first list be the solution since all are prime and sum is 2,013,817? Is the test case wrong?
Your solution will return 5 numbers instead of 6.
This comment has been hidden.
please update your tests on JavaScript. I got this errors:
assertSimilar is deprecated, use assert.deepEqual
assertSimilar is deprecated, use assert.deepEqual
ok. Thanks for attempting to solve this kata using JavaScript. It will be fixed.
we are still waiting
i have the same error
C# Translation
Approved +1. I've just seen that this one was pending. @dfhwze I'm sorry
ah cool, I forgot about that one :)
D translation
approved
Ruby 3.0 should be enabled
Unnecessary logs should be removed
JS Node 14. should be enabled
Unnecessary logs should be removed
Description should be language-agnostic
COBOL translation.
New test framework should be used in Python.
Done.
Tests shouldn't log anything.
Done for python..
This comment has been hidden.
Description formatting is broken.
Looks already fixed
Python 3 should be enabled.
Done.
the method primesfrom2to to generate primes that is used in "Show Kata Description" is incredible. Does anyone know the name of the algorithm and how does it work?
This comment has been hidden.
Thanks Voile for your time. I was looking for your solution but didn't find it. Wilson Prime's kata, my goodness, don't remind me that. :)
I am passing the test cases , but after i try the attempt cases , i get this error--> Response received but no data was written to STDOUT or STDERR. SIGKILL Process exited prematurally with a SIGKILL signal. Can anyone please help me out what this means?
That's most likely your code's problem. Please check again.
My solution seems to work for this Kata but I think the author's is flawed. He lists the following test conditions:
But the first sextuplet of primes > 70 is not [7, 11, 13, 17, 19, 23] (this equals 90). The correct answer is [5, 7, 11, 13, 17, 19] (equals 72). And that third test case is completely off because the total of the array shown is well over 6,000,000, and the correct sextuplet should be [333323, 333331, 333337, 333341, 333349, 333367]. Am I not understanding the requirements?
[5, 7, 11, 13, 17, 19]
does not satisfy the[p, p + 4, p + 6, p + 10, p + 12, p + 16]
criteria. I think you've got the intervals switched, like[p, p + 2, p + 6, p + 8, p + 12, p + 16]
I think [4, 8, 10, 14, 16, 20] is a better answer, it equals 72.
It should be prime numbers. It means a whole number greater than 1 whose only factors are 1 and itself.
Hello, i did this Kata on my IDE, but when it searches in the 2000000 on CodeWars, it takes longer than 12 seconds and i get an error. I don't want to look at solutions, but anybody managed to do a fast enough program?
Me too have the same problm.Can anybody optimize it
Due to some changes on the servers, the javascript version is having problems now. Seven people passed before without problems. I checked the python and ruby version and are working fine.
Let's see if I can make some changes to speed it up.
same problem here ;/ only the first 2 tests get executed
Hi @hovacink. I've just checked the test in the four languages and are working well. Python may experiment being timed out once in ten attempts. For the other versions the runtime is under 3500 ms. Hope that you can solve it.
Every prime number except 2 and 3 is of the form 6k+1 or 6k-1 , this property can be used to avoid unnecessary looping:)
Please, change the colour of the description to something more neutral, as reading it now is quite challenging.
Yeah, this thing seriously scared me on the home page...