Because \$k^2\$ is the sum of the \$k\$ first odd positive integers, squared numbers can be represented as ASCII-art triangles of height \$k\$ as follows:
1²=1 2²=4 3²=9 4²=16 ...
*
* ***
* *** *****
* *** ***** *******
Besides, any positive integer \$n\$ can be represented as a sum of squares by iteratively subtracting the highest square less than or equal to \$n\$.
For instance: \$119=10^2+4^2+1^2+1^2+1^2\$
Note that this is a greedy algorithm which is not necessarily the shortest possible sum which, according to Lagrange's four-square theorem, never exceeds 4 terms (e.g. \$119=10^2+3^2+3^2+1^2\$).
Task
Given an integer \$n\ge1\$, output an ASCII-art made by superimposing the triangles representing the squares of the greedy decomposition described above.
The triangles must be bottom-aligned and horizontally centered.
The first triangle is filled with \$1\$'s. The second triangle turns the \$1\$'s into \$2\$'s. The third triangle turns the \$2\$'s into \$3\$'s, and so forth.
It is assumed that the input is such that its greedy decomposition does not exceed \$9\$ squares1.
Standard I/O rules apply. Extra leading and/or trailing whitespace is acceptable as long as the output is well formatted.
1. According to A006892, the smallest integer for which 10 squares are required is \$453694852221687377444001767\$.
Test cases
Input: 1
1
Input: 9
1
111
11111
Input: 13
1
121
12221
Input: 119
1
111
11111
1111111
111111111
11111111111
1111112111111
111111222111111
11111122222111111
1111112225222111111
Input: 165
1
111
11111
1111111
111111111
11111111111
1111111111111
111111111111111
11111111211111111
1111111122211111111
111111112232211111111
11111111223432211111111