wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> medium >> An interesting game
(Message started by: wonderful on Jun 12th, 2008, 11:13pm)

Title: An interesting game
Post by wonderful on Jun 12th, 2008, 11:13pm
You are given two positive integers A and B. The object is to start with A and turn it into B, through a series of steps. In each step you can add, subtract, multiply by, divide by, or take the power/root of another positive integer.

Sound easy? There's another part: There is a COST for each modification, and you want to find the cheapest method to get from A to B. Let the number you are using = N.

Adding or subtracting N costs N dollars.
Multiplying or dividing by N costs N+2 dollars.
Powering or rooting with N costs 2N dollars. (You have 3 options here. If C is the current number, you can take C^N, N^C, or the Nth root of C.)

Your final total = the above costs + N dollars (where N is the number of steps in your method).

Remember-- Throughout your steps, the number must remain a positive integer. You can't subtract it to negative, or make it a fraction through division.

And lastly, you cannot multiply twice in a row or divide twice in a row.

So for example, try to get from 5 to 91.

1) Multiply by 18 (20 dollars)
2) Add 1 (1 dollar)
20 + 1 + 2 steps = 23.00

...or...

1) Add 2 (2 dollars)
2) Multiply by 13 (15 dollars)
2 + 15 + 2 steps = 19.00

How about:

12 to 345
64 to 729
6 to 8888
142857 to 100

Please feel free to aks more.

Have A Great Day!

Title: Re: An interesting game
Post by towr on Jun 13th, 2008, 2:06am
12 to 345  
[hide]((12-1)^2 -6)*3[/hide]  20

64 to 729  
[hide]((64^1/3) +1)^3[/hide]  16

6 to 8888  
[hide]((6^5)+1)/7*8[/hide]  34

142857 to 100  
[hide](142857*7+1)^1/3[/hide]  18 19

Title: Re: An interesting game
Post by rmsgrey on Jun 13th, 2008, 9:34am
I notice that the added cost of N for N steps is equivalent to increasing each step's price by 1, so:

+-N costs N+1
*/N costs N+3
power/root with N costs 2N+1


Also, alternate $19 routes for 5->91:

5*2=10 $5
10+3=13 $4
13*7=91 $10

or

5*3=15 $6
15-2=13 $3
13*7=91 $10

or

5+8=13 $9
13*7=91 $10

12 to 345
[hide]((12+1)^2+3)*2+1[/hide] $18

and I make the cost of towr's 142857 to 100 $19



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board