Find the position number inside an arrangement

20 Views Asked by At

I want to ask a really easy question that has been bugging me for a bit.

Suppose we have a box like: $3\times7$ or $4\times6$ or $5\times7$. So $3$ rows$(y)$ and $7$ columns$(x)$. What is the equation that will let me know of a certain position's number assuming the $3$ and $7$ are provided counting from left to right. eg: the position with number $(3$, $4)$ is: x$18$ or $2-6$ is: x$13$.

            3 x 7
+---+---+---+---+---+---+---+
|x1 |x2 |x3 |x4 |x5 |x6 |x7 |
+---+---+---+---+---+---+---+
|x8 |x9 |x10|x11|x12|x13|x14|
+---+---+---+---+---+---+---+
|x15|x16|x17|x18|x19|x20|x21|
+---+---+---+---+---+---+---+
1

There are 1 best solutions below

0
On BEST ANSWER

For your layout, it's clear that each number is greater than the number above it by the column count $K$ (in the example $K=7$). So the row will figure in as a multiplier on the column count. This leads to the formula:

$(row-1)\times K + (column)$