Artificial intelligent assistant

Expression for the order number of domino tiles The domino tiles can be listed in an orderly way as shown in the figure : ![]( figure link **Write an expression** such that given two variables ("minor" and "major") where "minor" is the lowest value and "major" the highest value of a domino tile, **calculate its order number associated with the previous figure.** **Example** : given a domino tile with numbers 1 and 5, the expression must calculate the order number 11. Given a tile with numbers 4 and 6 the expression must calculate the order number 24 * * * From the domino tile with numbers (0,0) to (1,6) the expression "6 * minor + major" works but from the next domino tile, the expression begins to fail and I can't find a general expression. Can someone help me please?

Let $x$ be the minor number and $y$ be the major number. It looks easier to me to count downward because there is one tile with $x=6$, two tiles with $x=5$ and so on. There are $\frac 12(6-x)(7-x)$ tiles in the rows with minor numbers greater than $x$ so the last index in the row above $x$ is $28-\frac 12(6-x)(7-x)$. Now we count down $7-y$ tiles in the current row, giving a final result of $$21-\frac 12(6-x)(7-x)+y$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 27e75676a8e76d5b905c24a9f307122d