# Turn 16 into 25. You have 4 magic spells. Can you do it?

You have been given the number 16. You also have 4 magic spells. You have to use the spells to turn 16 into 25.

Each spell changed your number a specific way, but the objective is never altered, you must make 25.

Spell List:

• Halfzenumzaber: Half your number (e.g: 16 -> 8)
• Dogaubtale: Double your number (e.g: 16 -> 32)
• Conracayutekonate: Concatenate your number with the same number (e.g: 16 -> 1616)
• subhatractlfplones: Half the number, then subtract 1 (e.g: 16 -> 7)

Current Best: 7

Is it possible to get 25? If so, what's the least amount of moves it takes, if not, prove it's impossibility.

• @warspyking should that be 4.5 for Halfzenumzaber, but 3.5 for subhatractlfplones? – ladyofcats Feb 3 '15 at 1:12
• @warspyking What happens if you use Conracayutekonate none-hole numbers like 3.5? Would that become 353.5? – fibonatic Feb 3 '15 at 1:20
• Did you have a solution in mind when you posted this? – xnor Feb 3 '15 at 5:31
• @xnor Not really. I like to ask genuine stuff – warspyking Feb 3 '15 at 10:16
• You sure like to copy haha – Avigrail Feb 3 '15 at 11:10

Here's one answer that I think would be shortest:

16 to 1616 to 808 to 404 to 202 to 100 to 50 to 25. (7 moves) Basically you need to halve from 50/52/100-104/etc. The only other possibilities would be to halve 16 first then go to 88 or 77, but there's no way to get to 25 faster. Similarly, going to 32 then 64, etc., there's no way. This is basically a proof by exhaustion, eliminating the other two branches that could potentially beat 7.

• Are you positive 7 is unbeatable by any other method? – warspyking Feb 2 '15 at 23:59
• I tested all shorter possibilities with Mathematica. They do not work. This is therefore the shortest. – Milo Brandt Feb 3 '15 at 2:31

It may not be the fewest number of spells, but it's definitely possible in 7:

Letting s represent subhatractlfplones and d represent Dogaubtale:
16 s 7 d 14 d 28 s 13 d 26 d 52 s 25

There are 5 possible solutions that use 7 steps:

16 -> 7 -> 14 -> 28 -> 13 -> 26 -> 52 -> 25
16 -> 7 -> 14 -> 28 -> 56 -> 27 -> 12.5 -> 25
16 -> 32 -> 15 -> 6.5 -> 13 -> 26 -> 52 -> 25
16 -> 32 -> 64 -> 31 -> 14.5 -> 6.25 -> 12.5 -> 25
16 -> 1616 -> 808 -> 404 -> 202 -> 100 -> 50 -> 25

There are no solutions that use less than 7 steps. And probably a lot that use 8 or more.

I can also attest to a proof that doesn't beat 7. But there is a 7 that I believe does so with more style as it uses non-integers.

16 d 32 s 15 s 6.5 d 13 d 26 d 52 s 25

I also found a few identities:

d s = subtract 1
s d = subtract 2
s s d = d d s

To perform the proof that 7 operations is the minimum, I looked at it from this perspective:

So for each operation (h, d, c, and s) I defined an inverse (h', d', c', and s'):

• h(x) = x / 2, so h'(x) = x * 2
• d(x) = x * 2, so d'(x) = x / 2
• (note that d'(x) == h(x) and h'(x) == d(x), convenient)
• c(x) = x * (10^(floor(log10(x)) + 1), so c'(x) = x / ((10^(floor(log10(x)/2)+1) IFF that denominator is an integer
• s(x) = (x / 2) - 1, so s'(x) = (2 * x) + 2

• 16 can be transformed into 8, 32, 1616, and 7.

• Those can be transformed into ....
• A few more steps
• Only 50, 52 and 12.5 can transform into 25.

With steps 1-to-2 and steps 7-8 defined, we can work our way to the middle. We can eliminate a lot of duplicate answers though, since if an answer appears earlier in a chain, we would never use that path since a shorter one already exists.

25 * 2 = 50
(50 /2) -1 =24
24/2 = 12
12/2=6
(6/2) -1 = 2
2*2 = 4
4*2 = 8
8*2 =16

• Your answer is not valid. You have to do the reverse. – cst1992 Mar 2 '16 at 8:34