Go back
Tough one...

Tough one...

Posers and Puzzles

L

Joined
08 Mar 03
Moves
13753
Clock
26 Mar 03
2 edits
Vote Up
Vote Down

A set of numbers as follows in 5 colums:

1______2______3______4______5
9______8______7______6______-
-______10_____11_____12_____13
17____16_____15_____14______-
-______18_____19_____20_____21

and so on (ignore the - and _ I've included them to make formatting better).

If I asked what column is 18 in, you would say column 2.
The problem is as follows.

Derive a formula which will provide the column any specific number lies in given that the above pattern continues to infinity. i.e. the number x lies in column y.

Good luck.

Acolyte
Now With Added BA

Loughborough

Joined
04 Jul 02
Moves
3790
Clock
26 Mar 03
Vote Up
Vote Down

Originally posted by Lazaraus
A set of numbers as follows in 5 colums:

1______2______3______4______5
9______8______7______6______-
-______10_____11_____12_____13
17____16_____15_____14______-
-______18_____19_____20_____21

and so on (ignore the - and _ I've included them to make formatting better).

If I asked what column is 18 in, you would say column 2.
The problem is as ...[text shortened]... that the above pattern continues to infinity. i.e. the number x lies in column y.

Good luck.
How about this:

y = min(f(x-1)+1,f(-x)+2)

where f(a) = b : 0<=b<=7 and b=a (mod 8)

L

Joined
08 Mar 03
Moves
13753
Clock
26 Mar 03
Vote Up
Vote Down

Originally posted by Acolyte
How about this:

y = min(f(x-1)+1,f(-x)+2)

where f(a) = b : 0<=b<=7 and b=a (mod 8)
That seems to work - well done.
How long did it take you?

ct[

Joined
18 Mar 03
Moves
249
Clock
27 Mar 03
Vote Up
Vote Down

Acolyte
Now With Added BA

Loughborough

Joined
04 Jul 02
Moves
3790
Clock
29 Mar 03
Vote Up
Vote Down

Originally posted by Lazaraus
That seems to work - well done.
How long did it take you?
A few minutes. I noticed it was doing something modulo 8, so I wrote out a table and noticed I could get what I wanted as the minimum of two things.

Cookies help us deliver our Services. By using our Services or clicking I agree, you agree to our use of cookies. Learn More.