[Question]
  [
## Challenge
Given a positive integer \$N\$, repeat each of its digits \$d\_1, d\_2, d\_3, \cdots, d\_n\$ a number of times corresponding to its position in \$N\$. In other words, each digit \$d\_k\$ should be repeated \$k\$ times (for each \$1\le k\le n\$, 1-indexed), thus creating the new number:
$$\overline{d\_1d\_2d\_2d\_3d\_3d\_3\cdots\underbrace{d\_nd\_nd\_n\cdots d\_n}\_{n\text { times}}}$$
Then, write it down both horizontally and vertically and fill in the blanks with copies of the digit that corresponds to the greater index between the column index and the row index of the blank space. The final output should look like this:
$$\begin{bmatrix}
 \color{red}{d\_1} \color{green}{d\_2 d\_2} \color{blue}{d\_3 d\_3 d\_3} \cdots \\ 
 \color{green}{d\_2 d\_2 d\_2} \color{blue}{d\_3 d\_3 d\_3} \cdots \\ 
 \color{green}{d\_2 d\_2 d\_2} \color{blue}{d\_3 d\_3 d\_3} \cdots \\ 
 \color{blue}{d\_3 d\_3 d\_3 d\_3 d\_3 d\_3} \cdots \\ 
 \color{blue}{d\_3 d\_3 d\_3 d\_3 d\_3 d\_3} \cdots \\ 
 \color{blue}{d\_3 d\_3 d\_3 d\_3 d\_3 d\_3} \cdots \\ 
 \vdots 
\end{bmatrix}$$
---
## Specs
You may take \$N\$ as an integer, a string, a list of digits or a list of characters representing the digits. The output can be a newline-separated string, a list of strings / integers or a list of lists of characters / digits, but please include a pretty-print version too, if possible. If the output is a newline-separated string, it is also acceptable to:
* have leading / trailing whitespace, as long as the visual appearance of the output doesn't change
* separate the columns using a consistent amount spaces or the rows with a consistent (non-zero) amount of newlines
You can take input and provide output through any [standard method](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods), while taking note that [these loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden by default. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so try to complete the task in the least bytes you can manage in your [language](https://codegolf.meta.stackexchange.com/a/2073/59487) of choice.
## Test cases
```
65:
655
555
555
---------------
203:
200333
000333
000333
333333
333333
333333
--------------
233:
233333
333333
333333
333333
333333
333333
---------------
5202:
5220002222
2220002222
2220002222
0000002222
0000002222
0000002222
2222222222
2222222222
2222222222
2222222222
---------------
12345:
122333444455555
222333444455555
222333444455555
333333444455555
333333444455555
333333444455555
444444444455555
444444444455555
444444444455555
444444444455555
555555555555555
555555555555555
555555555555555
555555555555555
555555555555555
```
  
[Answer]
# JavaScript (ES7), 70 bytes
Takes input as a string. Returns a string with a trailing linefeed.
```
s=>(g=x=>(c=s[(x>y?x:y)**.5-1>>1])?c+g(x+8):x>y?`
`+g(1,y+=8):'')(y=1)
```
[Try it online!](https://tio.run/##bcxBCoMwFATQvRfJ/6aKiU0pwo8HKQUl1VARU5pSktOncVvcDMwbmGX8jt68n69PtbnHlGZKnjRYCjkN@RsEHfvQRSzLWlVCa3HH3nALgV@x28ehGHIVp8gpC2MIkQQm4zbv1qlenYUZ2EUxxOIPZdMeqJKNPGAh2/N@kn4 "JavaScript (Node.js) – Try It Online")
## How?
### Method
We build the output character by character by walking through a square matrix and converting each cell into an index \$i\_{x,y}\$ into the input string.
### Coordinates to string index
The upper bound \$u\_{n}\$ of the \$n^{th}\$ digit area (0-indexed) along each axis is given by [A000096](https://oeis.org/A000096):
$$u\_{n} = \frac{n(n+3)}{2}$$
$$u\_{0}=0,u\_{1}=2,u\_{2}=5,u\_{3}=9,u\_{4}=14,u\_{5}=20,\dots$$
Given an integer \$k\$, we can find out in which area \$n=\lfloor{x}\rfloor+1\$ it is located by solving:
$$x²+3x-2k=0$$
Leading to:
$$x = \frac{\sqrt{1+8k}-3}{2}$$
$$n = \left\lfloor\frac{\sqrt{1+8k}-3}{2}\right\rfloor+1=\left\lfloor\frac{\sqrt{1+8k}-1}{2}\right\rfloor$$
For each cell \$(x, y)\$, we define:
$$v\_{x,y} = \max(1+8x,1+8y)$$
These values \$v\_{x,y}\$ are converted into indices \$i\_{x,y}\$ into the input string by doing:
$$i\_{x,y} = \left\lfloor\frac{\sqrt{v\_{x,y}}-1}{2}\right\rfloor$$
```
 v(x,y) |  0  1  2  3  4  5  6  7  8  9        i(x,y) |  0  1  2  3  4  5  6  7  8  9
--------+-------------------------------      --------+-------------------------------
    0   |  1  9 17 25 33 41 49 57 65 73           0   |  0  1  1  2  2  2  3  3  3  3
    1   |  9  9 17 25 33 41 49 57 65 73           1   |  1  1  1  2  2  2  3  3  3  3
    2   | 17 17 17 25 33 41 49 57 65 73           2   |  1  1  1  2  2  2  3  3  3  3
    3   | 25 25 25 25 33 41 49 57 65 73           3   |  2  2  2  2  2  2  3  3  3  3
    4   | 33 33 33 33 33 41 49 57 65 73   -->     4   |  2  2  2  2  2  2  3  3  3  3
    5   | 41 41 41 41 41 41 49 57 65 73           5   |  2  2  2  2  2  2  3  3  3  3
    6   | 49 49 49 49 49 49 49 57 65 73           6   |  3  3  3  3  3  3  3  3  3  3
    7   | 57 57 57 57 57 57 57 57 65 73           7   |  3  3  3  3  3  3  3  3  3  3
    8   | 65 65 65 65 65 65 65 65 65 73           8   |  3  3  3  3  3  3  3  3  3  3
    9   | 73 73 73 73 73 73 73 73 73 73           9   |  3  3  3  3  3  3  3  3  3  3
```
### Halting conditions
We know that we've reached:
* the right boundary of the matrix when the character at \$i\_{x,y}\$ does not exist and we have \$x > y\$
* the bottom boundary of the matrix when the character does not exist and we have \$x \le y\$
[Answer]
# [J](http://jsoftware.com/), 16 15 bytes
-1 byte thanks to FrownyFrog!
```
{~#\<:@>./~@##\
```
[Try it online!](https://tio.run/##y/qfVmyrp2CgYKVg8L@6TjnGxsrBTk@/zkFZOea/JpeSnoJ6mq2euoKOQq2VQloxF1dqcka@QpqCupmpOoStrg4XMzIwxhQ0NTIwwhQ1NDI2MVX/DwA "J – Try It Online")
Takes `N` as a string.
## Explanation of th initial solution:
```
              #\   finds the length of the successive prefixes of the input (1 2 3...)
            #~     copies each digit as many times (1 2 2 3 3 3...)  
       >./~@       and creates a table of the max of the row/col numbers
  [:<:@            then subtract 1 from each element (for indexing)
{~                 select the corresponding digit from the input
```
Test session with input `203`:
```
   #\ '203'
1 2 3
   #~#\ '203'
1 2 2 3 3 3
   >./~@#~#\ '203'
1 2 2 3 3 3
2 2 2 3 3 3
2 2 2 3 3 3
3 3 3 3 3 3
3 3 3 3 3 3
3 3 3 3 3 3
   <:@>./~@#~#\ '203'
0 1 1 2 2 2
1 1 1 2 2 2
1 1 1 2 2 2
2 2 2 2 2 2
2 2 2 2 2 2
2 2 2 2 2 2
   ({~[:<:@>./~@#~#\) '203'
200333
000333
000333
333333
333333
333333
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 7 bytes
```
Jx`»þ`ị
```
[Try it online!](https://tio.run/##y0rNyan8/9@rIuHQ7sP7Eh7u7v7//3@0qY6CkY6CAZCMBQA "Jelly – Try It Online")
[Clarified output.](https://tio.run/##y0rNyan8/9@rIuHQ7sP7Eh7u7v5/uN39//9oUx0FIx0FAyAZCwA)
[Answer]
# [Haskell](https://www.haskell.org/), ~~60~~ ~~59~~ 58 bytes
```
f x|s<-do(n,_)<-zip[0..]x;n<$[0..n]=[(x!!).max a<$>s|a<-s]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P02hoqbYRjclXyNPJ17TRrcqsyDaQE8vtsI6z0YFxMqLtY3WqFBU1NTLTaxQSLRRsSuuSbTRLY79n5uYmadgq5CbWOCrUFBaElxS5JOnoKKQpqBkbGRooPQfAA "Haskell – Try It Online")
---
### Point-free version (68 bytes)
```
(map=<<(.((snd.).max)).flip map).((\t@(n,c)->t<$[1..n])=<<).zip[1..]
```
[Try it online!](https://tio.run/##y0gszk7NyfmfZhvzXyM3scDWxkZDT0OjOC9FT1MvN7FCU1MvLSezQAEopQkUjylx0MjTSdbUtSuxUYk21NPLi9UEatHUq8osAHFj/@cmZuYp2ILU@yoUlJYElxT55CmoKKQpKBkbGRoo/f@XnJaTmF78XzfCOSAAAA "Haskell – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 71 bytes
```
i=j=0;r=''
for x in input():i+=1;r+=x*i
for c in r:print j*c+r[j:];j+=1
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P9M2y9bAushWXZ0rLb9IoUIhMw@ICkpLNDStMrVtDa2LtG0rtDLBkskgySKrgqLMvBKFLK1k7aLoLKtY6yygsv//1ROTklMS1QE "Python 2 – Try It Online")
First generates the first row `r`, then iterates over `r` to print each line.
[Answer]
# [R](https://www.r-project.org/), 59 bytes
```
function(a){m=outer(x<-rep(g<-seq(a),g),x,pmax);m[]=a[m];m}
```
[Try it online!](https://tio.run/##K/qfZvs/rTQvuSQzP08jUbM61za/tCS1SKPCRrcotUAj3Ua3OLUQKKGTrqlToVOQm1ihaZ0bHWubGJ0ba51b@z9NI1lD3UhdR90EiA2A2FxdU5MrTUPdUB1EQSVBEsZAif8A "R – Try It Online")
* I noticed that taking a vector of digits is acceptable, and this allowed me to save 21 bytes :)
* -2 bytes thanks to @Giuseppe suggestion to accept only character vector
* -2 bytes assigning in arguments definition
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), 16 bytes
```
{⍵[∘.⌈⍨(/⍨⍳⍴⍵)]}
```
I'm separating this solution from the post with my J answer, as suggested by Jo King
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v8/7VHbhOpHvVujH3XM0HvU0/God4WGPpB41Lv5Ue8WoIRmbC1QlYK6mak6FxeQNjIwhjAMjYxN1LkA "APL (Dyalog Classic) – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~14~~ ~~11~~ 10 bytes
Saved 1 byte thanks to *Magic Octopus Urn* / *Adnan*
```
ƶJDv¬N×?=¦
```
[Try it online!](https://tio.run/##MzBNTDJM/f//2DYvl7JDa/wOT7e3PbTs/38DQzNDcwA "05AB1E – Try It Online")
**Explanation**
```
ƶ            # repeat each element its index (1-based) times 
 J           # join to string
  Dv         # for N in [0 ... len(string)-1] do
    ¬N×      # push the head repeated N times
       ?     # print without newline
        =    # print the rest of the string without popping
         ¦   # remove the head
```
[Answer]
# [Python 2](https://docs.python.org/2/), 74 bytes
```
i=1;a=[]
for c in input():exec"a=zip(*a+[c*-~len(a)]);"*i;i+=2+i%2
print a
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P9PW0DrRNjqWKy2/SCFZITMPiApKSzQ0rVIrUpOVEm2rMgs0tBK1o5O1dOtyUvM0EjVjNa2VtDKtM7VtjbQzVY24Cooy80oUEv//Vzc3MzVRBwA "Python 2 – Try It Online")
[Answer]
# Excel VBA, 95 bytes
An anonymous VBE immediate window funtion that takes input from `[A1]` and outputs to the console
```
n=[len(A1)]:For y=1To n:For l=1To y:?:For x=1To n:?String(x,Mid([A1],IIf(x>y,x,y)));:Next x,l,y
```
### Ungolfed and commented
```
n=[len(A1)]                         ''  Get Length
For y=1To n                         ''  Iterate down input
For l=1To y                         ''  Iterate down repeat lines
?                                   ''  Print Newline
For x=1To n                         ''  Iterate accross input
?String(x,Mid([A1],IIf(x>y,x,y)));  ''  Print x of the `max(x,y)`th digit in input
Next x,r,y                          ''  Loop, Loop, Loop
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~15~~ 12 bytes
```
tftY"t!2$X>)
```
[Try it online!](https://tio.run/##y00syfn/vyStJFKpRNFIJcJO8/9/dTNTdQA "MATL – Try It Online")
I suspect this can be shortened, but it's not so bad...
```
          % implicit input, '230'
t         % duplicate input. Stack: ['230','230']
f         % indices of nonzero values. Stack: ['230',[1,2,3]]
t         % duplicate. Stack: ['230',[1,2,3],[1,2,3]]
Y"        % run-length decoding. Stack: ['230',[1,2,2,3,3,3]]
t         % duplicate. Stack: ['230',[1,2,2,3,3,3],[1,2,2,3,3,3]]
!         % transpose. Stack: ['230',[1,2,2,3,3,3],[1;2;2;3;3;3]]
2$X>      % elementwise maximum of 2 inputs, with broadcast.
          % Stack:
          % ['230',
          % [1, 2, 2, 3, 3, 3;
          %  2, 2, 2, 3, 3, 3;
          %  2, 2, 2, 3, 3, 3;
          %  3, 3, 3, 3, 3, 3;
          %  3, 3, 3, 3, 3, 3;
          %  3, 3, 3, 3, 3, 3]]
 )        % index into G
          % implicit end, display stack contents
```
[Answer]
# [Add++](https://github.com/cairdcoinheringaahing/AddPlusPlus), 35 bytes
```
L,bLRdBcB]£X¦Ω+d‽b>1€Ω_A€Ω:AbLR¦+$T
```
[Try it online!](https://tio.run/##S0xJKSj4/99HJ8knKMUp2Sn20OKIQ8vOrdROedSwN8nO8FHTmnMr4x3BlJUjUNGhZdoqIf9ddLLyM/N0HOp0uDi9uLhcdAqKUktKKguKMvNKdBysgKJOLtU5iblJKYkKhrVcnClOGVycBs4gEmhUNUgzUDQpNA8kYmjgrGRra6sEpLW1ubhUkMyyMzNF5RsZGKMKmBoZGKGKGBoZm5j@BwA "Add++ – Try It Online")
## How it works
We take input as a list of digits, while prevents us from a) having to cast to digits with `BD`, and also from having to save the digits, which would take two bytes.
First, we generate a range from **[1 ... len(input)]** with `bLR`, then we repeat each element \$n\$ in the range \$n\$ times. As automatic vectorisation doesn't exist in Add++, we zip it with itself, `dBcB]`, to create a list of pairs \$[[1, 1], [2, 2] ... [n, n]]\$. We then apply *[starmap](https://docs.python.org/3/library/itertools.html#itertools.starmap)*, coupled with repetition over the pairs: `£X` before concatenating them into one flat array (`¦Ω+`).
Next, we duplicate this array and table it by maximum, `d‽b>`. I.e. each element in the array is paired with each other element from the second array and the *dyadic maximum* command is run over the pair. For an example input of **[6 5]**, this creates the array **[1 2 2 2 2 2 2 2 2]**, which is a flattened version of the mosaic, as the indexes for the array. Unfortunately, Add++ uses 0-indexed arrays, so we need to decrement each element: `1€Ω_`.
Then, we index into the input list, by pushing the input again (`A`), which again saves bytes by taking input as a list. Index into the list with `€Ω:` before chopping the array into the appropriately lengthed pieces. If the number of digits in the input is denoted by \$x\$, then the piece size is
$$\frac{x(x - 1)}{2}$$
or the \$x^{th}\$ [triangular number](https://en.wikipedia.org/wiki/Triangular_number). We generate that by pushing the input's length, calculating the range from **1** to that value, then taking the sum with `AbLR¦+`. Now, the stack, for an input of **[6 5]**, looks like **[[6 5 5 5 5 5 5 5 5] 3]**. `T` chops the array into pieces of size \$n\$, but the arguments are currently in the wrong order, so we swap them with `$` before chopping and returning with `T`.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 17 bytes
```
Ｆ⮌…ＬθＵＯ⊕⊘×ι⁺³ι§θι
```
[Try it online!](https://tio.run/##HYrBCsIwEAV/ZY8rRJCKJ0/eLAhK8Qdi@kwD2w1NYvDvY3AuA8O4xSYXrbT2jol4QkXK4MmqB9@gviy87Tp0f0lUz6O6hBVaMPPVSu16hhWZg6GHfDIfDYX@G7qUUWd8efuHc2un4TC0fZUf "Charcoal – Try It Online") Explanation:
```
Ｆ⮌…Ｌθ
```
Loop over the indices of the characters in reverse order.
```
⊕⊘×ι⁺³ι
```
Calculate the size of the square.
```
ＵＯ...§θι
```
Draw the square using the current character.
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), 12 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
ø╶｛；ｌ└²＋：＊；ｎ
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JUY4JXUyNTc2JXVGRjVCJXVGRjFCJXVGRjRDJXUyNTE0JUIyJXVGRjBCJXVGRjFBJXVGRjBBJXVGRjFCJXVGRjRF,i=JTIyNTIwMiUyMg__,v=3)
[Answer]
# [Python 2](https://docs.python.org/2/), ~~76~~ 73 bytes
-3 bytes thanks to [Lynn](https://codegolf.stackexchange.com/users/3852/lynn).
```
l=0;m=[]
for k in input():l+=1;m=[r+l*k for r in m]+l*[l*-~l/2*k]
print m
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P8fWwDrXNjqWKy2/SCFbITMPiApKSzQ0rXK0bQ1BUkXaOVrZCiDpIpB0biyQH52jpVuXo2@klR3LVVCUmVeikPv/v7qRgbE6AA "Python 2 – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 14 [bytes](https://github.com/somebody1234/Charcoal/wiki/Code-page)
```
Ｅ⭆θ×⊕κι×⊕κι‖Ｏ↗
```
**[Try it online!](https://tio.run/##S85ILErOT8z5///9nqWP1rad23F4@qOuqed2ndsJZzxqmPZ@z/pHbdP//zc1MjD6r5sPAA "Charcoal – Try It Online")**
### How?
```
Ｅ⭆θ×⊕κι×⊕κι‖Ｏ↗ - implicitly print the result of...
Ｅ                - map:
  ⭆              -   over: string map:       
    θ             -     over: first input
     ×            -     using: repeat
        ι         -       what: ι (loop value)
      ⊕κ          -       by: incremented κ (loop counter)
         ×        -   using: repeat
            ι     -     what: ι (loop value)
          ⊕κ      -     by: incremented κ (loop counter)
             ‖Ｏ  - Reflect with overlap:
                ↗ -   direction: up-right
```
...can this method be golfed?
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 12 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ü°√¿«│⌠º₧@\τ
```
[Run and debug it](https://staxlang.xyz/#p=81f8fba8aeb3f4a79e405ce7&i=%2265%22%0A%22203%22%0A%225202%22%0A%2212345%22&a=1&m=2)
Using [this algorithm](https://codegolf.stackexchange.com/a/167358/78123).
Explanation:
```
c%R:BXm]i*xit+ Full program, implicit input
c%             Length of input
  R            1-based range
   :B          Repeat each element according to the range ("123" -> "122333")
     X         Save to X register
      m        Map:
       ]         Character -> string
        i*       Repeat by iteration index
          xit    Trim first <iteration index> elements from X
             +   Concatenate
                 Implicit output with newline
```
### [Stax](https://github.com/tomtheisen/stax), ~~20~~ ~~19~~ ~~18~~ 16 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ù↔‼i,ÑΓæ☺=╘‼æ↕4╝
```
[Run and debug it](https://staxlang.xyz/#p=81c3141c192d5b6a76a66a474d2b4a015e29&i=%2265%22%0A%22203%22%0A%225202%22%0A%2212345%22&a=1&m=2)
Explanation:
```
c%R:BX%mYx%{y|Mvx@m Full program, implicit input
c%                  Length of input
  R                 1-based range
   :B               Repeat each element according to the range ("123" -> "122333")
     X              Save to X register
      %             Length
       m            Map over 1-based range:
        Y             Save index to Y register
         x%           Push length of X register
           {      m   Map over 1-based range:
            y|M         Maximum of both indices
               v        1-based -> 0-based (decrement)
                x@      Index into X register
                      Implicit output with newline
```
[Answer]
# [Attache](https://github.com/ConorOBrien-Foxx/Attache), 34 bytes
```
{_[Table[Max,Flat!{_&_}=>1:#_]-1]}
```
[Try it online!](https://tio.run/##SywpSUzOSP2fpmBl@786PjokMSknNdo3sULHLSexRLE6Xi2@1tbO0Eo5PlbXMLb2v19qakpxtEpBQXJ6LBeXS2ZxQU5iZUhqcYlzYnFqcXSag0tmemZJsY5CtJmpjoKRgbGOgqmRgZGOgqGRsYlpbOx/AA "Attache – Try It Online")
## Explanation
Works similarly to [Galen Ivanov's J answer](https://codegolf.stackexchange.com/a/167338/31957).
```
{_[Table[Max,Flat!{_&_}=>1:#_]-1]}
{                                }   anonymous function: _ is input, array of digits
                                     example: _ := [2, 0, 3]
                         1:#_        the range 1 to Size[_]
                                     > e.g.: [1, 2, 3]
                  {   }=>            over each number N:
                   _&_                   map to N repeated N times
                                     > e.g.: [[1], [2, 2], [3, 3, 3]]
             Flat!                   flatten it
                                     > e.g.: [1, 2, 2, 3, 3, 3]
   Table[Max,                ]       create a "max" table with it
                                     > e.g.:
                                       1 2 2 3 3 3
                                       2 2 2 3 3 3
                                       2 2 2 3 3 3
                                       3 3 3 3 3 3
                                       3 3 3 3 3 3
                                       3 3 3 3 3 3
                              -1     subtract 1 from each
                                     > e.g.:
                                       0 1 1 2 2 2
                                       1 1 1 2 2 2
                                       1 1 1 2 2 2
                                       2 2 2 2 2 2
                                       2 2 2 2 2 2
                                       2 2 2 2 2 2
 _[                             ]    index the original array with this matrix
                                     > e.g.:
                                       2 0 0 3 3 3
                                       0 0 0 3 3 3
                                       0 0 0 3 3 3
                                       3 3 3 3 3 3
                                       3 3 3 3 3 3
                                       3 3 3 3 3 3
```
[Answer]
# [K (ngn/k)](https://gitlab.com/n9n/k), 16 bytes
```
{x@i|\:i:&1+!#x}
```
[Try it online!](https://tio.run/##y9bNS8/7/z/NqrrCIbMmxirTSs1QW1G5ovZ/mpKZqRJXmpKRgTGIMjUyMALRhkbGJkr/AQ "K (ngn/k) – Try It Online")
[Answer]
# [QBasic 1.1](http://www.qbasic.net), 127 bytes
```
INPUT S$
FOR X=1TO LEN(S$)
K=K+X
R$=R$+STRING$(X,MID$(S$,X,1))
NEXT
FOR C=1TO K
?STRING$(C-1,MID$(R$,C,1))RIGHT$(R$,K-C+1)
NEXT
```
-4 thanks to [DLosc](https://codegolf.stackexchange.com/questions/167337/lets-design-a-digit-mosaic/167356?noredirect=1#comment404548_167356).
Uses a modified version of [xnor's Python 2 algorithm](https://codegolf.stackexchange.com/a/167358/41024).
Input is an unquoted string. Output is `\n`-separated without extra spaces or `\n`s.
[Answer]
# [QBasic](https://archive.org/details/msdos_qbasic_megapack), 111 bytes
An anonymous function that prompts for input and outputs to the console.
```
INPUT s$
n=LEN(s$)
FOR y=1TO n
FOR l=1TO y
?
FOR x=1TO n
z=x
IF y>x THEN z=y
?STRING$(x,MID$(s$,z));
NEXT x,l,y
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~130~~ 126 bytes
-4 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)
Who needs fancy maths when you can bruteforce?
```
n,l;R(n,c){for(;n--;)putchar(c);}f(s){for(char*p=s,*q;*p++;)for(n=l=p-s;l--;R(1,10))for(R(n*-~n/2,p[-1]),q=p;*q;)R(++q-s,*q);}
```
[Try it online!](https://tio.run/##NU5Nj4IwED3bX0FITGZKm4Wqe9gJf4Lr6sHUgCQ4FuruxeBfZ6dsPM2b95Xnbef9srAZqAE2Hp/tfQJiawnDz8NfzxN4pLmF@C8lRoc6Gj2SDkVBmFiuhzrYSIPkGqhMVeLKS6e2L/5wJnzb6oRmrANJEhsoitGmFilffu/9JevW7kxHVE@1CVPPjxbybfw68pFzk0UktUk75Mi0CLnQ8sxKiTW7nXuGNdpB/nlISkKu3L3hwZXujSu326@eefkD "C (gcc) – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 13 bytes
```
Þżṅ:ẏ(:hnẋ₴…Ḣ
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLDnsW84bmFOuG6jyg6aG7huovigrTigKbhuKIiLCIiLCIwMTYxNyJd)
## How?
```
Þżṅ:ẏ(:hnẋ₴…Ḣ
Þż            # Repeat each character in the (implicit) input its 1-based index amount of times
  ṅ           # Join by nothing
   :          # Duplicate
    ẏ(        # Loop over [0...length), where the current iteration = n
      :h      # Duplicate and get the first character
        nẋ    # Repeat it n amount of times
          ₴   # Print without a trailing newline
           …  # Print without popping with a trailing newline
            Ḣ # Remove the first item
```
[Answer]
# [Php 7.1](http://www.php.net), 163 bytes
Via CLI providing the number as an argument:
```
<?foreach(str_split($argv[1])as$k=>$d)$a[]=array_fill(0,$s+=$k+1,array_fill(0,$s,$d));foreach(array_replace_recursive(...array_reverse($a))as$v)echo join($v)."\n";
```
Not so golfed:
```
$n = 123;
foreach(str_split($n) as $k => $d) {
    $s += $k + 1;
    $a[] = array_fill(0, $s, array_fill(0, $s, $d));
}
foreach(array_replace_recursive(...array_reverse($a)) as $v)
    echo implode('', $v) . "\n";
```
Output:
```
122333
222333
222333
333333
333333
333333
```
Method:
Basically build multi-dimensional array squares consisting of the digit, and then superimpose all of them (array\_replace\_recursive).
(Yes, I know this is embarrassingly long.)
[Answer]
# [Ruby](https://www.ruby-lang.org/), 80 bytes
```
->n{s=(1..n.size).map{|i|n[i-1]*i}*"";(0...s.size).map{|i|s[i]*i+s[i..-1]}*"\n"}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6vuthWw1BPL0@vOLMqVVMvN7GguiazJi86U9cwViuzVktJyVrDQE9PrxhVQXF0JlBaG0jp6QFVAtXF5CnV/o9WMjNV0lFQMjIwBlGmRgZGINrQyNjEVCkWojmvRqGgtKRYIS06L7b2PwA "Ruby – Try It Online")
Similar to [ovs answer](https://codegolf.stackexchange.com/a/167344/81225)
[Answer]
# Japt, 12 bytes
Takes input as a string, outputs an array of strings.
```
Ë+pE
¬£h°YçX
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.5&code=yytwRQqso2iwWedY&input=IjEyMzQiCi1S)
---
## Explanation
```
            :Implicit input of string U
Ë           :Map each character D at 0-based index E
  pE        :  Repeat D E times
 +          :  Append to D
\n          :Reassign to U
¬           :Split to character array
 £          :Map each element X at 0-based index Y
   °Y       :  Increment Y
     çX     :  Repeat X Y times
  h         :  Replace the first Y characters in U with that
```
[Answer]
# [uBASIC](https://github.com/EtchedPixels/ubasic), 120 bytes
An anonymous function that takes input foprm STDIN and outputs to STDOUT
```
0Input"",S$:N=Len(S$):ForY=1ToN:ForL=1ToY:ForX=1ToN:ForC=1ToX:Z=X:IfY>XThenZ=Y
1?Mid$(s$,z,1);:NextC:NextX:?:NextL:NextY
```
[Try it online!](https://tio.run/##K01KLM5M/v/fwDOvoLRESUknWMXKz9YnNU8jWEXTyi2/KNLWMCTfD8TyAbEiQawIuJgziBVhFWUbYeWZFmkXEZKRmhdlG8llaO@bmaKiUayiU6VjqGlt5ZdaUeIMJiOs7MG0D5iM/P/f0MjYBAA "uBASIC – Try It Online")
[Answer]
# [Visual Basic .NET (VBC)](http://www.mono-project.com/docs/about-mono/releases/5.12.0/#vbnet-compiler), 198 bytes
A `Sub`routine that takes input from STDIN and outputs to STDOUT. 
Couldn't seem to get StrDup to work :/
```
Module M
Sub Main
Dim c,s,n,l,x,y
s=Console.readLine()
n=Len(s)
For y=1To n
For l=1To y
For x=1To n
For c=1To x
Console.Write(Mid(s,IIf(x>y,x,y),1)&IIf(c=n,vbLf,""))
Next c,x,l,y 
End Sub
End Module
```
[Try it online!](https://tio.run/##TY49C8IwFEX3/IrgIAm8ClXXuPgBhdZFwblJUwjEF2jakvz62EYEp3feHe49s/FTawvZeqMK1GMxS5VS47rJatqQxyRp0xokF/OmCjwgWAgQiRdnh95ZvRt029UGNeMERa2ReU5ubqBRlE9HMbPNHDOHv1xlDuTX9RrMqFljOuahqnoWTnFd41Dy7forgTDLuofNhnNy12FcpMKiFCm5YkcX3Xy//imV@8PxAw "Visual Basic .NET (VBC) – Try It Online")
[Answer]
# Lua, 149 140 bytes
Function which accepts a list of digit strings and prints the result to stdout. This is my first attempt at code golf (and the language choice isn't helping either) so bear with me :)
[Try it online!](https://tio.run/##VYzBCgIhGIRfRf4uiiJrp9r4r@5D1B60dWEhNHQl2OjZTSOCDjMMzDdzy6YMWObsr@sSPDVMi4SdAJhDJBaV2BkyBZIwSWnOduyju1PLnJ9O/8QS5CMuq6O0knDxwL5ofdxQcyvqnKsxRICE26fUTMrUp2yp5qp9kqoykCccQBBQzfbNul86wqu8AQ "Lua – Try It Online")
```
function(a)F,s=0,""for b=1,#a do s=s..a[b]:rep(b)end;for b=1,#a do io.write((s.."\n"):rep(b))F,z=F+b,a[b+1]or""s=z:rep(F)..s:sub(F+1)end end
```
Ungolfed:
```
G = function(p)
    F,s = 0,""
    for i=1,#p do
        s=s..p[i]:rep(i)
    end
    for i=1, #p do
        io.write((s.."\n"):rep(i))
        F,z = F+i, p[i+1]or""
        s = z:rep(F)..s:sub(F+1)
    end
end
-- allows to pass the argument list from stdin
-- example: {"1", "2", "3", "4", "5"}
G(load("return " .. io.read())())
```
[Answer]
## [Perl 5](https://www.perl.org/) + `-nalF -M5.010`, 67 bytes
```
s/./$&x++$-/ge;eval'eval"say;"x++$i;$x+=$i;s/.{$x}/$F[$i]x$x/e;'x@F
```
[Try it online!](https://tio.run/##K0gtyjH9/79YX09fRa1CW1tFVz891Tq1LDFHHUQoFSdWWiuBxDOtVSq0bYEUUGm1SkWtvopbtEpmbIVKhX6qtXqFg9v//4YGYPgvv6AkMz@v@L9uXmKO239dX1M9oDAA "Perl 5 – Try It Online")
]