# Find the number of line and column where the number 2002 stays.

#### anemone

##### MHB POTW Director
Staff member
Positive real numbers are arranged in the form:

$$\displaystyle 1 \;\;\; 3 \;\;\; 6 \;\;\;10 \;\;\; \cdots$$
$$\displaystyle 2 \;\;\;5 \;\;\;9 \;\;\; \cdots$$
$$\displaystyle 4 \;\;\;8 \;\;\; \cdots$$
$$\displaystyle 7 \;\;\; \cdots$$

Find the number of the line and column where the number 2002 stays.

#### Opalg

##### MHB Oldtimer
Staff member
Positive real numbers are arranged in the form:

$$\displaystyle 1 \;\;\; 3 \;\;\; 6 \;\;\;10 \;\;\; \cdots$$
$$\displaystyle 2 \;\;\;5 \;\;\;9 \;\;\; \cdots$$
$$\displaystyle 4 \;\;\;8 \;\;\; \cdots$$
$$\displaystyle 7 \;\;\; \cdots$$

Find the number of the line and column where the number 2002 stays.
You will have noticed that the $n$th element in the top row is the $n$th triangular number $\frac12n(n+1)$. Then working back from that, each time you subtract $1$ you move back one column and down one row (until you reach the first column).

The $63$rd triangular number is $2016$, so that will be in row $1$, column $63$. Working back $14$ places from that, you find that $2002$ will be in row $1+14 =15$ and column $63-14=49$.

#### anemone

##### MHB POTW Director
Staff member

My solution:

 Number Row Column Group 1 1 1 1st 2 2 1 2nd 3 1 2 2nd 4 3 1 3rd 5 2 2 3rd 6 1 3 3rd 7 4 1 4th 8 3 2 4th 9 2 3 4th 10 1 4 4th 11 5 1 5th 12 4 2 5th 13 3 3 5th 14 2 4 5th 15 1 5 5th

To see where the number 2002 stays in the table above, we first need to investigate at which group that it lies, and this could be done in the following manner:

$$\displaystyle S_n=\frac{n}{2}\left(n+1\right)$$

$$\displaystyle 2002=\frac{n}{2}\left(n+1\right)$$

$$\displaystyle n=62.78$$

We know that 2002 must lie in the 63th group, and to know what the previous number in the 62th group is, we do the following:

$$\displaystyle S_62=\frac{62}{2}\left(62+1\right)=1953$$

Thus, we have:

 Number Row Column Group 1953 1 62 62th 1954 63 1 63th ... ... ... ...

To find where the number 2002 lies in the 63th group, i.e. how far it is from 1954, we compute:

$$\displaystyle 2002-1954=48$$

Hence, 2002 lies in the $$\displaystyle 63-48=15th$$ row and the $$\displaystyle 1+48=49th$$ column.

#### melese

##### Member
I tried to find a formula depending only on $k$, namely, given a positive integer $k$, to find its location $(C_k,R_k)$ in the table. For brevity of reference, we say that $k=(C_k,R_k)$ (abuse of notation)

Considering the obvious diagonals, it's clear that '$k$ is in the $n$'th diagonal' is equivalent to '$T_{n-1}<k\leq T_n$(*) for some integer $n\geq1$'.

Notice that for the diagonal $\{(1,n),(2,n-1),...,(1+x,n-x),...(n,1)\}$ we have $(1+x,n-x)=(1,n)-x=T_n-x$, because the numbers are consecutive.
Since $k$ lies on this diagonal, we may set $k=T_n-x$ and obtain $(C_k,R_k)=(1+(T_n-k),n-(T_n-k))$ (I expect the ambiguity of the notaion to be confusing, but I hope I'm wrong)

Now we want to "eliminate" $n$. For this, we go back to one of(*): $T_{n-1}<k\Leftrightarrow T_{n-1}+1\leq k\Leftrightarrow n^2-n+2\leq 2k\Leftrightarrow (n-1/2)^2+7/4\leq2k\Leftrightarrow n\leq\frac{(8k-7)^{1/2}+1}{2}$

From (*), it clear that $n$ is the greatest integer that satisfies $T_{n-1}<k$, and therfore the greatest to satisfy $n\leq\frac{(8k-7)^{1/2}+1}{2}$; so by definition $n=\lfloor\frac{(8k-7)^{1/2}+1}{2}\rfloor$.

At last, the answer: The location of $k$ is $(T_n-k+1,n+k-T_n)$, where $n=\lfloor\frac{(8k-7)^{1/2}+1}{2}\rfloor$.

Example: Take $k=2002$, then $n=63$ and hence $2002$ lies in $(T_{63}-2002+1,63+2002-T_{63})=(15,49)$.

መለሰ