6 kyu

Goldbach’s Conjecture

262 of 381Protino
Description
Loading description...
Mathematics
Algorithms
  • Please sign in or sign up to leave a comment.
  • KayleighWasTaken Avatar

    Description is contradictory, claims that n is both always even but also provides a prescribed return value for when n is odd. Python at least also tests for odd n which likely should be removed.

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • dfhwze Avatar

    Ruby error on submit:

    main.rb:48:in block in sol_goldbach_partitions': uninitialized constant Prime (NameError) from main.rb:47:in tap' from main.rb:47:in sol_goldbach_partitions' from main.rb:57:in block (3 levels) in

    ' from main.rb:55:in times' from main.rb:55:in block (2 levels) in
    ' from /runner/frameworks/ruby/cw-2.rb:55:in block in describe' from /runner/frameworks/ruby/cw-2.rb:46:in measure' from /runner/frameworks/ruby/cw-2.rb:51:in describe' from /runner/frameworks/ruby/cw-2.rb:202:in describe' from main.rb:54:in block in <main>' from /runner/frameworks/ruby/cw-2.rb:55:in block in describe' from /runner/frameworks/ruby/cw-2.rb:46:in measure' from /runner/frameworks/ruby/cw-2.rb:51:in describe' from /runner/frameworks/ruby/cw-2.rb:202:in describe' from main.rb:20:in
    '

  • Seniru Avatar

    My code is correct as I test it on my local computer. But it takes too much time to run here and failed with an execution error. Maybe the problem is with my connection. Any ideas please?

  • pranav098 Avatar

    made a list of prime values in python from 0 to n and checked if sum of two primes is equal to n and first value less than or equal to second value then converted them to string and appended values to partition list ... sampe tests are successful when submitting got the error 'NameError: name 'primes' is not defined' for large integers.......any help please

  • GiacomoSorbi Avatar

    JavaScript and Crystal translations kumited (plus I was beaten by a short time translating it into Ruby).

    Also, needs random test cases (try to look at my Crystal code, it should be fine to use the native Python randint to get the same in your language).

  • mentalplex Avatar

    Surprised this was approved without random tests. Please add random tests.

  • anter69 Avatar

    Description updated and example tests fixed.

  • zellerede Avatar

    Well, actually 7=2+5, so the example 7 -> [] written in the description is not justified.

  • Scopula Avatar

    Good one! It seems to already exist, if you search goldbach in katas you will find two others.

    Maybe make a slight change to your problem to make it unique?

  • smile67 Avatar

    Hi, i think there are some mistakes:

    • 15=[]? Isn't it "2+13" (later tests contain another wrong case)
    • results of testcase messages are switched: "should equal..." and "user..." output

    (by the way i think it's a duplicate, found it three times at the "kata search", two of it are python and... no random tests;-))