Is there some trick to this puzzle.... It's really getting on my nerves...

I need money, but this thing is almost impossible... I managed to finish it once under 6 minutes but got 2000 gil...

I'm talking about the 15 numbers puzzle on the ship.