Pekka
Level: Smiter
Rank Points: 302
Registered: 09-19-2007
IP: Logged
|
Integer paths (+5)
Here is a little puzzle I invented. I think it is likely someone else has invented the same puzzle too, or at least explored a similar one. With that in mind, I'll explain it to you.
Suppose you are trapped in the origin of the two-dimensional Cartesian coordinate system. Wait, that sounds too exciting. Suppose you are just visiting. (You can leave any time. Go to some lovely non-Euclidean space or wherever.)
You are at the point (0,0). Now, you can travel into any of the four main directions and take a single unit length step. Then you have to change direction and take two unit length steps. And so on.
Just to make sure, the four main direction are towards the increasing y coordinates, and we can call this north, towards the decreasing y coordinates for south, increasing x for east and decreasing x for west. To keep it short, we can call these N, S, E and W. Because you can only move in these directions, you'll always end up in a spot that has integer coordinates.
Changing direction in this puzzle means turning exactly 90 degrees left or right. You have to do this after every single turn, which consists of taking multiple steps in a straight line. The number of steps is the increasing sequence 1,2,3,4 and so on. (Some guy called Peano knows all about this stuff. I think they were used before him, though.)
For example, suppose you start by going north. You end up at the position (0,1) after taking the single step you start with. Then you choose to go east, so you end up at (2,1) and then north again, for the final position of (2,4) after three moves of one, two and three steps, respectively. You could simply say that your travels started with turns NEN in this case.
So, the questions are, suppose you keep doing this: Will you ever find your way to the point (0,0) again? If you do find a way, can you do it so your path never intersects itself? This means you cannot ever again visit a spot again, except for the origin where you finally end up, making a nice little (or possibly big) loop.
(Since we're on a Drod forum, one could always consider an infinite field of trapdoors overlaid with orthosquares. You are standing on a single floor square in the middle of that field and suddenly decide you just have to take one step north, and you do so. Then you make two steps east or west, then three steps north and south and so on. Can you return to that original floor tile just making these kinds of moves?)
And to close this off, here are two slightly harder questions:
Is such a path possible if instead of using consecutive integers, you use the Fibonacci numbers? They start with 1,1,2,3,5,8... and the next number is always the sum of two previous ones.
What about the sequence of primes? If you make moves that consists of first 2, then 3, then 5 steps, and so on, taking the length from consecutive primes, can you again make a non-self-intersecting path that returns to the origin?
(And as a bonus question, can you think of any other sequence of integers that makes this puzzle particularly interesting?)
I found out that I could find solutions to all these questions that I am reasonably sure are not wrong using just pen and paper. However, if you write an interesting computer program, you could share it as well. Please remember to use secret tags for now, though, so as not to spoil the puzzle for others.
You can also present solutions in a form that has only letters L and R for left and right turns, respectively. It doesn't really matter in which direction you start off, since the problem is symmetrical. Just be sure to specify which integer sequence you are using.
Well, I hope you enjoy this easy little puzzle. I have some answers I can post later, if that is necessary.
|