## Tuesday, August 26, 2008

### A Sequence Relationship

I thought I'd spend a minute to post this up, because some might find that trying to figure it out might be entertaining. So, I'm at work going through some code and I'm getting two sequences of 4 numbers. All I know is that these two sequences are related somehow, but there isn't much more information beyond that.

Unfortunately, I'm slow and I did not instantly see the relationship, and so I had to spend some time digging deeper into the code before all was revealed. Let's see if you can spot the relationship.

Sequence A: 11, 25, 165, 300
Sequence B: 64, 199, 339, 353

Hint: Think line numbers in text, or maybe think of a line of people. -- Too bad, I wasn't given this luxury. Could have saved myself 20 or so minutes of time.

Note: There's actually some practical meaning to the sequences.

#### 1 comment:

Brute Force said...

While there are a lot of 'answers' that could tie the two together, one of the simpler ones (and, the one that it actually was) is this: enumeration going from left-to-right as opposed to right-to-left.

Line up N people and give 4 of them hats. N happens to be 364, and you gave hats to persons 11, 25, 165, and 300 (enumerating based on 0, so we have individuals labeled from 0 to 363).

If you were to count going the other direction, but starting at 364 going to 1... the people with hats would be persons 64, 199, 339, and 353.

This might be considered an off-by-one error in addition to an orientation error. Anyway, just figured I'd post up the (non-unique, haha) solution.