Draft
Composed Integers Having Prime Factors Only Once
34 of 49raulbc777
Loading description...
Fundamentals
Mathematics
Algorithms
Data Structures
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.
JS Fork solving the issue everyone encountered.
.
Thanks, btw did this kata got back to draft after approval of the fork, or did you unpublish it for the moment being?
uh... Nope, I didn't do anything aside approving the fork. Raul is active so I guess he unpublished it? (note: I'd actually think it's better this way: we already have plenty of this kind of stuff)
Tests should not print to stdout.
duplicate issue
Description should be language-agnostic
marginally passed in 9 seconds.. :)
The output format should be changed to something more reasonable than what it is now.
Test framework and solution should be imported explicitly in Python.
Tests shouldn't log anything.
New test frameworks should be used in all languages.
I'm afraid that
@ChristianECooper
's comment is still valid:1
should not be included (not a compound, etc). I know that this exception is mentioned in the example, but it's just not right... and if you really stick to it, state it clearly in the description, not "hidden" in the example.Furthermore, the description should specify if the upper limit has to be included or not (based on the tests, not).
Oh, I suggest to make the example shorter, to make it less cluttered: e.g. up 50.
Cheers
Thanks for the feedback. I'll check it and see what I have to fix. Thanks for completing it.
Since you agreed with
@ChristianECooper
under, I've updated translations to exclude1
in answer. I also updated description to include@anter69
's suggestion.Why aren't primes counted? Their prime factors are themselves.
This kata is focused on composite numbers - as in its title, so no primes ;-)
Hi Raul, just submitted a JS solution, but i think there's an error in your testcases, for example look here:
As you can see, there's always a difference of one odd number which is your nMax number only if it is a prime number. Your solution adds this nMax prime number, but this isn't correct. My code does it too, to pass your tests - so will get invalid after your correction;-). Later on i will pass a correct version too...
I'll check it. This js doesn't want to obey me. :)
This comment has been hidden.
I think the issue is still there :(
I had to "bypass" this problem in the random tests (JS) as well. Otherwise, nice one ;)
Has this been fixed? (JS) I'm also getting a bunch of off-by-1 errors.
But seemingly results expect n to be included.
Edit: for random test n = 821:
If you check the difference in sums, the missing number is 821, which is == n (contradicts description), and is also a prime number, so why should it be included?
Apparently not... -> see this
I can't find the mistake in the kata code. I want to do a complete rewrite of this kata, but author is still active ..
Please find fork above to have this issue resolved.
I hate to be that guy, but... :)
The inclusion of
1
in your example as following this rule is invalid, it has no prime factors! :)Since yesterday I'm nervous when I read you. Just kidding.. :-). You're right, 1 does not have prime decomposition. I'll fix this even though many solutions passed. I should deserve an issue for that. Thanks for having compassion. I'll fix it!
No problem, that's what the beta phase of kata development is for! :)