The period ratio for kink and sausage modes in a magnetic slab