Ad
  • Custom User Avatar

    The simple, yet not so simple answer, is because AND/addition is closed under binary.

    so in binary, 1 + 1 == 2, which is outside of the domain of binary number for a single bit, making it 0. Meaning, in binary, the default OR is an XOR. so that is why you have the %2 to treat it as a bit.
    For further details, look into Rings.. that will give you a deeper understanding.

    https://en.wikipedia.org/wiki/Ring_(mathematics)

  • Custom User Avatar

    On postgresql and I get error that it should recieve X Values?

  • Custom User Avatar

    I am aware of that... but why say:"If n itself is a doubleton, return the next bigger than n.".. it is a redundant clause.. you can just say "find the next doubleton number." because in all cases, you are asking for the next.. it does not matter if the argument is a doubleton or not, correct?

  • Custom User Avatar

    why is the test for 10 = 12?? 10 is a doubleton.. the instructions is a bit confusing

  • Custom User Avatar

    i am having the same problem .. i even took all the successful codes after viewing the results, they all have the same problem and same result does not pass the test.

  • Custom User Avatar

    I don’t think so.. it is not the only x value that is correct computationally yet fails the test.

  • Custom User Avatar

    I think there are multiple errors in the testing; as an example x=316912650057057350374175801346. it expects False but the answer is True.
    Am i missing something?