A number of programming languages construct large integers through 'concatenating' the digit to the end of the existing number. For example, [Labyrinth](https://github.com/m-ender/labyrinth), or [Adapt](https://github.com/cairdcoinheringaahing/adapt). By concatenating the digit to the end, I mean that, if the existing number is \$45\$, and the digit is \$7\$, the result number is \$457\:(45 \times 10 + 7)\$.

A constructed number is a number that can be built this way through the use of the multiples of single digit numbers: \$1, 2, 3, 4, 5, 6, 7, 8, 9\$ A.K.A an element in one of these 9 sequences:

$$1, 12, 123, 1234, 12345, \: \dots$$
$$2, 24, 246, 2468, 24690, \: \dots$$
$$3, 36, 369, 3702, 37035, \: \dots$$
$$4, 48, 492, 4936, 49380, \: \dots$$
$$5, 60, 615, 6170, 61725, \: \dots$$
$$6, 72, 738, 7404, 74070, \: \dots$$
$$7, 84, 861, 8638, 86415, \: \dots$$
$$8, 96, 984, 9872, 98760, \: \dots$$
$$9, 108, 1107, 11106, 111105, \: \dots$$

To provide an example of how the sequences are constructed, here's how the sequence for \$a = 3\$ in constructed:

$$\begin{align}
u\_1 = && a = && 3 & = 3\\
u\_2 = && 10 \times u\_1 + 2 \times a = && 30 + 6 & = 36 \\
u\_3 = && 10 \times u\_2 + 3 \times a = && 360 + 9 & = 369 \\
u\_4 = && 10 \times u\_3 + 4 \times a = && 3690 + 12 & = 3702 \\
u\_5 = && 10 \times u\_4 + 5 \times a = && 37020 + 15 & = 37035 \\
u\_6 = && 10 \times u\_5 + 6 \times a = && 370350 + 18 & = 370368 \\
\end{align}$$
$$\vdots$$
$$\begin{align}
u\_{33} = && 10 \times u\_{32} + 33 \times a = && 37\dots260 + 99 & = 37\dots359 \\
u\_{34} = && 10 \times u\_{33} + 34 \times a = && 37\dots359 + 102 & = 37\dots3692
\end{align}$$
$$\vdots$$

\$u\_{33}\$ and \$u\_{34}\$ included to demonstrate when \$n \times a \ge 100\$. A *lot* of digits dotted out for space.

It may still not be clear how these sequences are constructed, so here are two different ways to understand them:

* Each sequence starts from the single digit. The next term is found by taking the next [multiple](https://en.wikipedia.org/wiki/Multiple_(mathematics)) of that digit, multiplying the previous term by \$10\$ and adding the multiple. In sequence terms:

$$u\_n = 10 \times u\_{n-1} + n \times a, \: \: u\_1 = a$$

where \$a\$ is a single digit (\$1\$ through \$9\$)

* Each of the \$9\$ elements at any point in the sequence (take \$n = 3\$ for instance) are the multiples of \$123\dots\$ from \$1\$ to \$9\$, where \$123\dots\$ is constructed by \$u\_{n+1} = 10 \times u\_n + n\$ \$(1, 12, 123, \dots, 123456789, 1234567900, 12345679011, \dots)\$

So the first values are \$1 \times 1, 2, 3, \dots, 8, 9\$, the second are \$12 \times 1, 2, 3, \dots, 8, 9\$, the third \$123 \times 1, 2, 3, \dots, 8, 9\$, etc.

Your task is to take a constructed number as input and to output the initial digit used to construct it. You can assume the input will always be a constructed number, and will be greater than \$0\$. It may be a single digit, which maps back to itself.

You may take input in any reasonable manner, including as a list of digits, as a string etc. It is acceptable (though not recommended) to take input in unary, or any other base of your choosing.

This is a [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest code wins!

Test cases
----------

```
       u_n        => a
 37035            => 3
 6172839506165    => 5
 5                => 5
 246913580244     => 2
 987654312        => 8
 61728395061720   => 5
 1111104          => 9
 11111103         => 9
 111111102        => 9
 2469134          => 2
 98760            => 8
 8641975308641962 => 7

```

or as two lists:

```
[37035, 6172839506165, 5, 246913580244, 987654312, 61728395061720, 1111104, 11111103, 111111102, 2469134, 98760, 8641975308641962]
[3, 5, 5, 2, 8, 5, 9, 9, 9, 2, 8, 7]

```

---

When I posted this challenge, I didn't realise it could be simplified so much by the method used in [Grimmy's answer](https://codegolf.stackexchange.com/a/191306/66833), and so therefore would be very interested in answers that take a more mathematical approach to solving this, rather than a 'digit' trick (Obviously all valid answers are equally valid, just what I'd be interested in seeing).