Problem 396
Posted: Wed Jan 30, 2013 4:16 pm
I saw that a previous thread on this problem had been locked, but I actually need something about this problem clarified, so I figured I'd start a new thread. If this is inappropriate, I apologize, and feel free to delete or lock this one too.
I keep getting an off-by-one error when calculating the length of the sequence and comparing it to the examples in the problem description. For instance, for G(2) the page says that the length is 3, but the way I calculate it, the sequence is {2,2,1,0}, with a length of 4. Similarly, I get 22 for G(4) and 382 for G(6).
This would be simple enough to correct (just subtract 1!), but I'm concerned that I might not be getting some part of the problem. Does the final 0 not count in the sequence, so that the sequence for G(2) is {2,2,1}, not {2,2,1,0}? That would be the most obvious answer, I guess. I have some ideas about how to solve it, but I really would like this clarified first.
Thanks!
I keep getting an off-by-one error when calculating the length of the sequence and comparing it to the examples in the problem description. For instance, for G(2) the page says that the length is 3, but the way I calculate it, the sequence is {2,2,1,0}, with a length of 4. Similarly, I get 22 for G(4) and 382 for G(6).
This would be simple enough to correct (just subtract 1!), but I'm concerned that I might not be getting some part of the problem. Does the final 0 not count in the sequence, so that the sequence for G(2) is {2,2,1}, not {2,2,1,0}? That would be the most obvious answer, I guess. I have some ideas about how to solve it, but I really would like this clarified first.
Thanks!