Multiplication tables in nested loops