Problem 544. Create a square matrix of multiples

Created by Bruce Raine

Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row. This also applies to each column i.e. each column containing multiples of the first element of each column.

EX: >>matrixMultiples(3)

     1     2     3
     2     4     6
     3     6     9

>>

Tags

Problem Group

74 solvers submitted 127 solutions (1.72 solutions/solver).

Problem Comments