Coordinates in a rectangular triangle Numbers from $1$ to $\frac{n^2+n}{2}$ are formed into a triangle: numbers from $1$ to $n$ form first column, numbers from $n+1$ to $2n - 1$ form second and so on untill last column has just one number.
For example with $n = 5$ we get 
$\begin{matrix}
1&&&&\\
2&6&&&\\
3&7&10&&\\
4&8&11&13&\\
5&9&12&14&15\\
\end{matrix}$
Is there a way to calculate coordinates of a number (it's row and column) given the number?
In other words: is there a formula $f_n: \mathbb R \rightarrow \mathbb R^2$ such that $f(x)  = (a, b)$ where $a$ is column and $b$ is the row in which $x$ is (in a triangle as in example).
 A: If we add up entire columns we can form a trapezoid with the exact same area:
$$
\begin{align}
5&=1\cdot 5\\
9&=2\cdot\frac{5+4}2\\
12&=3\cdot\frac{5+3}2
\end{align}
$$
This can be continuously interpolated by $x=y\cdot\frac{n+(n+1-y)}{2}$ which then leads to
$$
y^2-(2n+1)y+2x=0
$$
which is a quadratic equation in $y$ with solutions
$$
y=\frac{2n+1\pm\sqrt{(2n+1)^2-8x}}{2}
$$
This $y$ should be the column number for the cases $x=5,9,12$ etc. so it has to be the solution with the minus sign since we want $y<\frac{2n+1}{2}$ for the column number to be within the range $1,2,...,n$. It follows that the column number will be given by
$$
a=\left\lceil\frac{2n+1-\sqrt{(2n+1)^2-8x}}{2}\right\rceil
$$
and then it should not be too hard to find an expression for the row number using the difference between the actual $x$ and the $\bar x$ that fills up the entire column $\bar x=a\cdot\frac{n+(n+1-a)}{2}$.

This Wolfram Alpha computation confirms that my formula for the column number works for your example with $n=5$ and thus $2n+1=11$ so that $a=\left\lceil\frac{1}{2}(11-\sqrt{11^2-8x})\right\rceil$.

The final function will be given by
$$
f(x)=\left(a(x),b(x)\right)
$$
where
$$
\begin{align}
a(x)&=\left\lceil\tfrac{1}{2}\left(2n+1-\sqrt{(2n+1)^2-8x}\right)\right\rceil\\
b(x)&=n+x-a(x)\cdot\frac{2n+1-a(x)}{2}
\end{align}
$$
Perhaps $b(x)$ can be reduced by plugging in the expression for $a(x)$ and the simplifying.

And just to demonstrate, here is a test of the $b(x)$ formula for your example of $n=5$ using Wolfram Alpha again. It works just perfectly ;).
