Ad
  • Custom User Avatar

    how does that even work

  • Custom User Avatar

    Thanks for the help

  • Custom User Avatar

    .. and it is the least possible such number.

    This defines the order.

    This is not a 3 kyu kata for nothing. You may have to think hard.

  • Custom User Avatar

    but how do you get the order of when the numbers appear? why are the two ones not next to eachother? my code works with sequences not starting qith 0 but when they start with 0 my logic fails.

  • Custom User Avatar

    A Golomb-type sequence describes itself .. every number in the .. sequence is the number of times the corresponding number from the given sequence appears

    So, in 1 2 1 0 4 4 4 4 5 5 5 5 6 6 6 6 7 7 7 7, there is 1 zero, 2 ones, 1 two, 0 threes, 4 fours, 4 fives, 4 sixes, 4 sevens

    The numbers I've written as digits come from the expected sequence itself; the numbers I've written as words come from the input sequence.

    1 2 2 3 3 4 4 4 5 5 5 6 6 6 6 7 7 7 7 gives 0 zeroes, 1 one, 2 twos, 2 threes, 3 fours .., so it's not describing itself.

  • Custom User Avatar

    I dont understand the logic when given starts with 0.
    0 1 2 3 4 .. (1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8) should equal (1, 2, 1, 0, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7)
    Why is there two 1s and a 0 just there? what?

  • Custom User Avatar