[Question]
  [
This question has been spreading like a virus in my office. There are quite a variety of approaches:
Print the following:
```
        1
       121
      12321
     1234321
    123454321
   12345654321
  1234567654321
 123456787654321
12345678987654321
 123456787654321
  1234567654321
   12345654321
    123454321
     1234321
      12321
       121
        1
```
Answers are scored in characters with fewer characters being better.
  
[Answer]
# Clojure, ~~191~~ 179 bytes
```
#(loop[[r & s](range 18)h 1](print(apply str(repeat(if(< r 8)(- 8 r)(- r 8))\ )))(doseq[m(concat(range 1 h)(range h 0 -1))](print m))(println)(if s(recur s((if(< r 8)inc dec)h))))
```
-12 bytes by changing the outer `doseq` to a `loop`, which allowed me to get rid of the `atom` (yay).
A double "for-loop". The outer loop (`loop`) goes over each row, while the inner loop (`doseq`) goes over each number in the row, which is in the range `(concat (range 1 n) (range n 0 -1))`, where `n` is the highest number in the row.
```
(defn diamond []
  (let [spaces #(apply str (repeat % " "))] ; Shortcut function that produces % many spaces
    (loop [[row-n & r-rows] (range 18) ; Deconstruct the row number from the range
           high-n 1] ; Keep track of the highest number that should appear in the row
      (let [top? (< row-n 8) ; Are we on the top of the diamond?
            f (if top? inc dec) ; Decided if we should increment or decrement
            n-spaces (if top? (- 8 row-n) (- row-n 8))] ; Calculate how many prefix-spaces to print
        (print (spaces n-spaces)) ; Print prefix-spaces
        (doseq [m (concat (range 1 high-n) (range high-n 0 -1))] ; Loop over the row of numbers
          (print m)) ; Print the number
        (println)
        (if r-rows
          (recur r-rows (f high-n)))))))
```
Due to a bug in the logic in my first attempt (accidentally inserting the prefix-spaces between each number instead), I managed to get this:
```
1
1       2       1
1      2      3      2      1
1     2     3     4     3     2     1
1    2    3    4    5    4    3    2    1
1   2   3   4   5   6   5   4   3   2   1
1  2  3  4  5  6  7  6  5  4  3  2  1
1 2 3 4 5 6 7 8 7 6 5 4 3 2 1
12345678987654321
1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1
1  2  3  4  5  6  7  8  9  8  7  6  5  4  3  2  1
1   2   3   4   5   6   7   8   7   6   5   4   3   2   1
1    2    3    4    5    6    7    6    5    4    3    2    1
1     2     3     4     5     6     5     4     3     2     1
1      2      3      4      5      4      3      2      1
1       2       3       4       3       2       1
1        2        3        2        1
1         2         1
```
Not even correct ignoring the obvious bug, but it looked cool.
[Answer]
## J, ~~29 26 24 23 22~~ 21 chars
```
,.(0&<#":)"+9-+/~|i:8
```
Thanks to [FUZxxl](https://codegolf.stackexchange.com/users/134/fuzxxl) for the `"+` trick (I don't think I've ever used `u"v` before, heh).
### Explanation
```
                  i:8  "steps" vector: _8 _7 _6 ... _1 0 1 ... 7 8
                 |     magnitude
              +/~      outer product using +
            9-         inverts the diamond so that 9 is in the center
  (      )"+           for each digit:
      #                  copy
   0&<                   if positive then 1 else 0
       ":                copies of the string representation of the digit
                         (in other words: filter out the strictly positive
                          digits, implicitly padding with spaces)
,.                     ravel each item of the result of the above
                       (necessary because the result after `#` turns each
                        scalar digit into a vector string)
```
[Answer]
## APL (~~33~~ 31)
```
A⍪1↓⊖A←A,0 1↓⌽A←⌽↑⌽¨⍴∘(1↓⎕D)¨⍳9
```
If spaces separating the numbers are allowed (as in the Mathematica entry), it can be shortened to ~~28~~ 26:
```
A⍪1↓⊖A←A,0 1↓⌽A←⌽↑⌽∘⍕∘⍳¨⍳9
```
Explanation:
* (Long program:)
* `⍳9`: a list of the numbers 1 to 9
* `1↓⎕D`: `⎕D` is the string '0123456789', `1↓` removes the first element
* `⍴∘(1↓⎕D)¨⍳9`: for each element N of `⍳9`, take the first N elements from `1↓⎕D`. This gives a list: ["1", "12", "123", ... "123456789"] as strings
* `⌽¨`: reverse each element of this list. ["1", "21", "321"...]
* (Short program:)
* `⍳¨⍳9`: the list of 1 to N, for N [1..9]. This gives a list [[1], [1,2], [1,2,3] ... [1,2,3,4,5,6,7,8,9]] as numbers.
* `⌽∘⍕∘`: the reverse of string representation of each of these lists. ["1", "2 1"...]
* (The same from now on:)
* `A←⌽↑`: makes a matrix from the list of lists, padding on the right with spaces, and then reverse that. This gives the upper quadrant of the diamond. It is stored in A.
* `A←A,0 1↑⌽A`: A, with the reverse of A minus its first column attached to the right. This gives the upper half of the rectangle. This is then stored in A again.
* `A⍪1↓⊖A`: `⊖A` is A mirrored vertically (giving the lower half), `1↓` removes the top row of the lower half and `A⍪` is the upper half on top of `1↓⊖A`.
[Answer]
# Mathematica 83 49 43 54 51
```
Print@@#&/@(Sum[k~DiamondMatrix~17,{k,0,8}]/.0->" ")
```
![formatting improved](https://i.stack.imgur.com/O5CCH.png)
---
With 3 bytes saved thanks to Kelly Lowder.
**Analysis**
The principal part of the code, `Sum[DiamondMatrix[k, 17], {k, 0, 8}]`, can be checked on [WolframAlpha](http://www.wolframalpha.com/input/?i=Sum%5BDiamondMatrix%5Bk,%2017%5D,%20%7Bk,%200,%208%7D%5D%20%20).
The following shows the underlying logic of the approach, on a smaller scale.
```
a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}
```
![grids](https://i.stack.imgur.com/wTeyK.png)
[Answer]
# Python 2, ~~72~~ ~~69~~ ~~67~~ 61
Not clever:
```
s=str(111111111**2)
for i in map(int,s):print'%8s'%s[:i-1]+s[-i:]
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 79 bytes
```
v;main(i){for(;i<307;putchar(i++%18?v>8?32:57-v:10))v=abs(i%18-9)+abs(i/18-8);}
```
[Try it online!](https://tio.run/##S9ZNT07@/7/MOjcxM08jU7M6Lb9IwzrTxtjA3LqgtCQ5I7FII1NbW9XQwr7MzsLe2MjK1Fy3zMrQQFOzzDYxqVgjEyila6mpDWbrA9kWmta1//8DAA "C (gcc) – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~60~~ 59 bytes
```
for n in`111111111**2`:print`int('1'*int(n))**2`.center(17)
```
[Try it online!](https://tio.run/##K6gsycjPM/r/Py2/SCFPITMvwRAGtLSMEqwKijLzShKAWEPdUF0LROdpaoJk9JJT80pSizQMzTX//wcA "Python 2 – Try It Online")
Abuses backticks and repunits.
[Answer]
**Mathematica ~~55~~ ~~50~~ ~~45~~ ~~41~~ 38**
```
(10^{9-Abs@Range[-8,8]}-1)^2/81//Grid
Grid[(10^Array[{9}-Abs[#-9]&,17]-1)^2/81]
```
![Mathematica graphics](https://i.stack.imgur.com/BqZrm.png)
[Answer]
# Javascript, 114
My first entry on Codegolf!
```
for(l=n=1;l<18;n-=2*(++l>9)-1,console.log(s+z)){for(x=n,s="";x<9;x++)z=s+=" ";for(x=v=1;x<2*n;v-=2*(++x>n)-1)s+=v}
```
If this can be shortened any further, please comment :)
[Answer]
# [GolfScript](http://www.golfscript.com/golfscript/), 33 31 30 bytes
Another GolfScript solution
```
17,{8-abs." "*10@-,1>.-1%1>n}%
```
[Try it online!](https://tio.run/##S8/PSStOLsosKPn/39Bcp9pCNzGpWE9JQUnL0MBBV8fQTk/XUNXQLq9W9f9/AA "GolfScript – Try It Online")
Thank you to [@PeterTaylor](https://codegolf.stackexchange.com/users/194/peter-taylor) for another char.
**Previous versions:**
```
17,{8-abs" "*9,{)+}/9<.-1%1>+}%n*
```
[Try it online!](https://tio.run/##S8/PSStOLsosKPn/39Bcp9pCNzGpWElBSctSp1pTu1bf0kZP11DV0E67VjVP6/9/AA "GolfScript – Try It Online")
```
17,{8-abs" "*9,{)+}/9<.-1%1>n}%
```
[Try it online!](https://tio.run/##S8/PSStOLsosKPn/39Bcp9pCNzGpWElBSctSp1pTu1bf0kZP11DV0C6vVvX/fwA "GolfScript – Try It Online")
[Answer]
## PHP, 92 90 characters
```
<?for($a=-8;$a<9;$a++){for($b=-8;$b<9;){$c=abs($a)+abs($b++);echo$c>8?" ":9-$c;}echo"\n";}
```
Calculates and prints the Manhattan distance of the position from the centre. Prints a space if it's less than 1.
An anonymous user suggested the following improvement (84 characters):
```
<?for($a=-8;$a<9;$a++,print~õ)for($b=-8;$b<9;print$c>8?~ß:9-$c)$c=abs($a)+abs($b++);
```
[Answer]
# [Charcoal](http://github.com/somebody1234/Charcoal), 13 bytes
```
Ｆ⁹«ＧX⁻⁹ιＩ⁺ι¹↓
```
[Try it online!](https://tio.run/##AS0A0v9jaGFyY29hbP//77ym4oG5wqvvvKdY4oG74oG5zrnvvKnigbrOucK54oaT//8)
### How?
Draws nine, successively smaller, concentric number-diamonds on top of each other:
```
Ｆ⁹«   Loop ι from 0 to 8:
ＧX     Draw a (filled) polygon with four equilateral diagonal sides
⁻⁹ι      of length 9-ι
Ｉ⁺ι¹    using str(ι+1) as the character
↓       Move down one space before drawing the next one
```
[Answer]
# Vim, ~~62~~ ~~39~~ ~~38~~ 34 keystrokes
*Thanks to @DJMcMayhem for saving a ton of bytes*
*Thanks to @AaronMiller for saving 4 bytes by generating `12345678987654321` in a different way*
```
9i1<ESC>|C<C-r>=<C-r>"*<C-r>"
<ESC>qqYP9|xxI <ESC>YGpHq7@q
```
[Try it online!](https://tio.run/##K/v/3zLTULrGWchWSElLSIlLurAwMsCypqLCU0E60r3Ao9DcofD/fwA "V (vim) – Try It Online")
### Explanation:
```
9i1<ESC>                            Write 9 '1's, leaving the cursor at the end of the line
        |C                          Go to the first column and cut all that's to the right of the cursor (implictly into register "), entering insert mode
          <C-r>=                    Enter an expression:
                <C-r>"*<C-r>"        The contents of register " multiplied with itself
                             <CR>   Evaluate it, yielding 12345678987654321
qq                                  Start recording into register q
  YP                                Yank this entire line and Paste above
    9|                              Go to the 9th column
      xx                            Delete character under cursor twice
        I <ESC>                     Go to the beginning of the line and insert a space and enter normal mode
               Y                    Yank this entire line
                G                   Go to the last line
                 p                  Paste in the line below
                  H                 Go to the first line
                   q                End recording
                    7@q             Repeat this 7 times
```
[Answer]
# [JavaScript (V8)](https://v8.dev/), 81 bytes
```
for(i=9;--i+9;console.log(s))for(j=9;j;s=j--^9?k>0?k+s+k:" "+s:k+"")k=i<0?j+i:j-i
```
[Try it online!](https://tio.run/##FcnBDkAwDADQX5GdLE3F0TazP5GIIG3FRMXvD@/6eHomnS86b3y6UtZ81RRdQCRwYc6H5n1p9rzVau2f/CUHjYw4uiRDmwQUxJvKgHoBY6xE6tvEQJ6RSnkB "JavaScript (V8) – Try It Online")
[Answer]
# [Common Lisp](http://www.clisp.org/), 113 bytes
```
(defun x(n)(if(= n 0)1(+(expt 10 n)(x(1- n)))))(dotimes(n 17)(format t"~17:@<~d~>~%"(expt(x(- 8(abs(- n 8))))2)))
```
[Try it online!](https://tio.run/##HYtRCoMwEAWvsgjCC0XI9kcptfQqtkkgUFdpIuQrV0/XPngMDMz7E9PeGpwPh1CBGMSAmYSsYVzgy56JLakv4EF5Dm7LcfUJQjwahO27LplyV3m8Pe/V1Uftu3@r1UATlldSCk1nfdW39gM "Common Lisp – Try It Online")
First I noticed that the elements of the diamond could be expressed like so:
```
  1   =   1 ^ 2
 121  =  11 ^ 2
12321 = 111 ^ 2
```
etc.
`x` recursively calculates the base (1, 11, 111, etc), which is squared, and then printed centered by `format`. To make the numbers go up to the highest term and back down again I used `(- 8 (abs (- n 8)))` to avoid a second loop
[Answer]
# [Regenerate](https://github.com/dloscutoff/Esolangs/tree/master/Regenerate), ~~109~~ 108 bytes
```
(( {#2-1}| {8})($3${#3+1}|1)(${#4+1}$4|)\n){9}(( $6| )(${$7/10}|${$3/10})(${$8-1+1/$8*(#7-1)}|7){#7-1}\n){8}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72qKDU9NS-1KLEkdcGCpaUlaboWN3M0NBSqlY10DWtrFKotajU1VIxVqpWNtYF8QyCnWtkEyFQxqdGMydOstqwFqlYxq1EAyaiY6xsa1NYAGcYgBljIQtdQ21BfxUJLQ9lc11CztsZcsxrEqgXptqiF2Am1GuYEAA)
## Explanation
The solution is divided into two parts, which generate the upper half of the diamond (including the center line) and the lower half, respectively. The upper half consists of group 1, repeated nine times `(...\n){9}`; the lower half consists of group 5, repeated eight times `(...\n){8}`.
The first part of each group handles the spaces. (I've replaced space with underscore in the explanations for better visibility.)
Upper-half spaces:
```
( {#2-1}| {8})
(            )  Group 2:
 _{#2-1}         Space, repeated one less time than the previous length of group 2
        |        Or, if this is the first row and there is no previous value of
                 group 2...
         _{8}    Space, repeated eight times
```
Lower-half spaces:
```
( $6| )
(     )  Group 6:
 _$6      Space, concatenated to the previous value of group 6
    |     Or, if this is the first row and there is no previous value of
          group 6...
     _    A single space
```
Now for the diamond itself. It can be divided into four quadrants, and I used three different approaches to generate them:
### Top left & top right: concatenation
We generate the left half (including the center) of each row with group 3, and the right half with group 4. For both halves, observe that we can generate the next row by concatenating a digit to the previous row:
```
 1234 321
   |   |
   v   v
12345 4321
```
So we can use a similar approach to what we did for the bottom-half spaces. The only difference is that the character we're concatenating at each step needs to be calculated.
Top left quadrant:
```
($3${#3+1}|1)
(           )  Group 3:
 $3             Previous value of group 3
   ${    }      concatenated to the result of...
     #3+1       Previous length of group 3 plus 1
          |     Or, if this is the first row and there is no previous value of
                group 3...
           1    The digit 1
```
Top right quadrant:
```
(${#4+1}$4|)
(          )  Group 4:
 ${    }       The result of...
   #4+1        Previous length of group 4 plus 1
        $4     concatenated to the previous value of group 4
          |    Or, if this is the first row and there is no previous value of
               group 4...
               Empty string
```
### Bottom left: integer division
We generate the left half (including the center) of each row with group 7. Observe that each row is obtained by removing the rightmost digit from the previous row:
```
12345
  |
  v
 1234
```
If we treat the entire thing as an integer, we can perform this transformation easily by dividing it by ten:
```
(${$7/10}|${$3/10})
(                 )  Group 7:
 ${     }             The result of...
   $7/10              Previous value of group 7, divided by 10
         |            Or, if there is no previous value of group 7...
          ${     }    The result of...
            $3/10     Group 3 (the final upper-left quadrant row) divided by 10
```
### Bottom right: digit-by-digit
There isn't an easy way to remove a digit from the left side of a previous match, so for the right half of each bottom row, we resort to generating one digit at a time with group 8. Here are the first three rows that we need to generate:
```
7654321
654321
54321
```
Each digit is one less than the previous digit, except that we have to "reset" when we hit 1. The reset value is always one less than the length of the left half of the row, which we have access to as group 7.
How can we tell when we've hit 1? I used an integer-division trick I first developed for programming in [*Acc!!*](https://github.com/dloscutoff/Esolangs/tree/master/Acc!!): if N is a positive integer, then 1/N will be one iff N = 1 and zero if N > 1. Multiplying this quantity by (length of group 7) - 1 gives us the reset we need.
```
(${$8-1+1/$8*(#7-1)}|7){#7-1}
(                     )        Group 8 (generates one digit at a time):
 ${                }            The result of...
   $8-1                         Previous value of group 8, minus 1
       +                        Plus
              #7-1              The length of group 7 minus 1
        1/$8*(    )             if the previous value of group 8 equals 1
                    |           Or, if there is no previous value of group 8...
                     7          The digit 7
                       {    }  Generate this many digits on each row:
                        #7-1   One less than the length of group 7
```
[Answer]
## PowerShell (2 options): ~~92~~ ~~84~~ 45 bytes
```
1..8+9..1|%{' '*(9-$_)+[int64]($x='1'*$_)*$x}
1..9+8..1|%{' '*(9-$_)+[int64]($x='1'*$_)*$x}
```
> 
> Thanks to [Strigoides](https://codegolf.stackexchange.com/a/8709/9387) for the hint to use 1^2,11^2,111^2...
> 
> 
> 
---
> 
> Shaved some characters by: 
> 
> 
> * Eliminating `$w`.
> * Nested the definition of `$x` in place of its first use.
> * Took some clues from [Rynant's solution](https://codegolf.stackexchange.com/a/15336/9387):
> 	+ Combined the integer arrays with `+` instead of `,` which allows elimination of the parenthesis around the arrays and a layer of nesting in the loops.
> 	+ Used `9-$_` to calculate the length of spaces needed, instead of more complicated maths and object methods. This also eliminated the need for `$y`.
> 
> 
> 
Explanation:
`1..8+9..1` or `1..9+8..1` generates an array of integers ascending from 1 to 9 then descending back to 1.
`|%{`...`}` pipes the integer array into a `ForEach-Object` loop via the built-in alias `%`.
`' '*(9-$_)+` subtracts the current integer from 9, then creates a string of that many spaces at the start of the output for this line.
`[int64]($x='1'*$_)*$x` defines `$x` as a string of `1`s as long as the current integer is large. Then it's converted to int64 (required to properly output 1111111112 without using E notation) and squared.
![enter image description here](https://i.stack.imgur.com/vdi03.jpg)
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), ~~20~~ 19 bytes
```
(⍉⊢⍪1↓⊖)⍣2⌽↑,⍨\1↓⎕d
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ob2pm/qO2CQZcjzra0/5rPOrtfNS16FHvKsNHbZMfdU3TfNS72OhRz95HbRN1HvWuiAEL901N@Q9U/j8NAA "APL (Dyalog Classic) – Try It Online")
`⎕d` are the digits `'0123456789'`
`1↓` drop the first (`'0'`)
`,⍨\` swapped catenate scan, i.e. the reversed prefixes `'1' '21' '321' ... '987654321'`
`↑` mix into a matrix padded with spaces:
```
1
21
321
...
987654321
```
`⌽` reverse the matrix horizontally
`(`...`)⍣2` do this twice:
`⍉⊢⍪1↓⊖` the transposition (`⍉`) of the matrix itself (`⊢`) concatenated vertically (`⍪`) with the vertically inverted matrix (`⊖`) without its first row (`1↓`)
[Answer]
# [brainfuck](https://github.com/TryItOnline/brainfuck), ~~158~~ 154 bytes
```
++++++++[->+>++++>+>++++++<<<<]>>>++<<+[-[-<+>>.<]<[->+<]>>>>+>[->+<<.+>]>+[-<+<.->>]<<<.<<]>>>>-[<<<<+[-<+>>.<]<[->+<]>>>>>[->+<<+.>]>-[-<+<-.>>]<<-<.>>]
```
[Try it online!](https://tio.run/##bYzBCYBQDEMHCu0EJYt8elBBEMGD4Py1rf9oLgkkL@u9HNf@bGcEpoYQrDANsJSTrJT1EAOp5lbTbnLa2RR0ohamQnqS@sGUUT/4oycMTbjvTbRhsfKIFw "brainfuck – Try It Online")
```
[spaceMem, spaceCount, space, lf, "0", numCount, numMem]
++++++++[->+>++++>+>++++++<<<<]>>>++<<+
[ for spaceCount
    -[- for spaceCount minus 1
        <+ inc spaceMem
        >>. print space
        < go to spaceCount
    ] 
    <[->+<]> fetch spaceCount from spaceMem
    >>>+ inc number
    >[- for numCount
        >+  inc numMem
        <<.+ print and inc number
        >   go to numCount
    ]
    >+[- for numMem plus 1
        <+ inc numCount
        <.- print and decrement number
        >>  go to numMem
    ]
    <<<. print lf
    <<      go to spaceCount
]
>>>>-[      for numCount
    <<<<+[- for spaceCount plus 1
        <+ inc spaceMem
        >>. print space
        < go to spaceCount
    ] 
        <[->+<]> fetch spaceCount from spaceMem
    >>> inc number
    >[- for numCount
        >+  inc numMem
        <<+. print and inc number
        >   go to numCount
    ]
    >-[- for numMem minus 1
        <+ inc numCount
        <-. print and decrement number
        >>  go to numMem
    ]
    <<-     decrement number
    <. print lf
    >> go to numCount
]
```
[Answer]
# [Python 3](https://docs.python.org/3/), 54 bytes
saved another 3 bytes by letting the `int` function crash instead of a loop condition. Thanks to dingledooper.
```
i=8
while[print(f'{int("1"*(9-abs(i)))**2:^17}')]:i-=1
```
[Try it online!](https://tio.run/##K6gsycjPM/7/P9PWgqs8IzMnNbqgKDOvRCNNvRpEKRkqaWlY6iYmFWtkampqamkZWcUZmteqa8ZaZeraGv7/DwA "Python 3 – Try It Online")
[Python 3](https://docs.python.org/3/), 57 bytes
saved 1 byte by using f-Strings thanks to dingledooper.
```
i=8
while i+9:print(f'{int("1"*(9-abs(i)))**2:^17}');i-=1
```
[Try it online!](https://tio.run/##K6gsycjPM/7/P9PWgqs8IzMnVSFT29KqoCgzr0QjTb0aRCkZKmlpWOomJhVrZGpqamppGVnFGZrXqmtaZ@raGv7/DwA "Python 3 – Try It Online")
[Python 3](https://docs.python.org/3/), 58 bytes
Even shorter solution by a different approach (prints one extra space at the beginning of each line).
```
i=8
while i+9:j=abs(i);i-=1;print(' '*j,int('1'*(9-j))**2)
```
[Try it online!](https://tio.run/##K6gsycjPM/7/P9PWgqs8IzMnVSFT29IqyzYxqVgjU9M6U9fW0LqgKDOvRENdQV0rSwfMMlTX0rDUzdLU1NIy0vz/HwA "Python 3 – Try It Online")
[Python 3](https://docs.python.org/3/), 61 bytes (without extra spaces)
```
i=8
while i+9:j=9-abs(i);i-=1;print(f'%{8+j}d'%int('1'*j)**2)
```
[Try it online!](https://tio.run/##K6gsycjPM/7/P9PWgqs8IzMnVSFT29Iqy9ZSNzGpWCNT0zpT19bQuqAoM69EI01dtdpCO6s2RV0VxFU3VNfK0tTSMtL8/x8A "Python 3 – Try It Online")
These are my previous solutions:
[Python 3](https://docs.python.org/3/), 66 bytes
```
f=lambda c:f'%{8+c}d'%int('1'*c)**2
for c in f(9):print(f(int(c)))
```
[Try it online!](https://tio.run/##K6gsycjPM/7/P802JzE3KSVRIdkqTV212kI7uTZFXTUzr0RD3VBdK1lTS8uIKy2/SCFZITNPIU3DUtOqoAgkm6YBIpM1NTX//wcA "Python 3 – Try It Online")
[Python 3](https://docs.python.org/3/), 71 bytes:
```
f=lambda c:str(int('1'*int(c))**2)
for c in f(9):print(f(c).center(17))
```
[Try it online!](https://tio.run/##K6gsycjPM/7/P802JzE3KSVRIdmquKRIIzOvREPdUF0LRCdramppGWlypeUXKSQrZOYppGlYaloVFIHk0oCyesmpeSWpRRqG5pqa//8DAA "Python 3 – Try It Online")
[Answer]
### Ruby, ~~76~~ ~~69~~ ~~60~~ 54 characters
```
(-8..8).map{i=_1.abs;puts' '*i+"#{eval(?1*(9-i))**2}"}
```
(Thanks, Patrick, G B, and Slim Liser!)
Improvements welcome. :)
[Answer]
# k (~~64~~ 50 chars)
```
-1'(::;1_|:)@\:((|!9)#'" "),'$i*i:"J"$(1+!9)#'"1";
```
Old method: 
```
-1',/(::;1_|:)@\:((|!9)#\:" "),',/'+(::;1_'|:')@\:i#\:,/$i:1+!9;
```
[Answer]
# CJam, ~~31~~ 27 bytes
CJam is a lot newer than this challenge, so this answer is not eligible for being accepted. This was a neat little Saturday evening challenge, though. ;)
```
8S*9,:)+9*9/2%{_W%1>+z}2*N*
```
[Test it here.](http://cjam.aditsu.net/)
The idea is to form the upper left quadrant first. Here is how that works: 
First, form the string `" 123456789"`, using `8S*9,:)+`. This string is 17 characters long. Now we repeat the string 9 times, and then split it into substrings of length 9 with `9/`. The mismatch between 9 and 17 will offset every other row one character to the left. Printing each substring on its own line we get:
```
        1
23456789 
       12
3456789  
      123
456789   
     1234
56789    
    12345
6789     
   123456
789      
  1234567
89       
 12345678
9        
123456789
```
So if we just drop every other row (which conveniently works by doing `2%`), we obtain one quadrant as desired:
```
        1
       12
      123
     1234
    12345
   123456
  1234567
 12345678
123456789
```
Finally, we mirror this twice, transposing the grid in between to ensure that the two mirroring operations go along different axes. The mirroring itself is just
```
_      "Duplicate all rows.";
 W%    "Reverse their order.";
   1>  "Discard the first row (the centre row).";
     + "Add the other rows.";
```
Lastly, we just join all lines with newlines, with `N*`.
[Answer]
# jq `-nr`, 55 bytes
```
range(17)-8|fabs|" "*.+"123456789"[:9-.]+"87654321"[.:]
```
`fabs` is not supported on TIO but you can try it on <https://jqplay.org/>.
Alternatively [try it on TIO](https://tio.run/##yyr8/78oMS89VcPQXFPXokZPS6@muLCopEZJQUlLT1vJ0MjYxNTM3MJSKdrKUlcvVlvJwtzM1MTYyFApWs8q9v//f/kFJZn5ecX/dfOKAA) with `.*.|sqrt` instead of `fabs`, for 59 bytes.
[Answer]
# [jq](https://stedolan.github.io/jq/) `-rn`, ~~76~~ ~~65~~ ~~60~~ 59 bytes
*-6 bytes thanks to [ovs](https://codegolf.stackexchange.com/users/64121/ovs) and another -6 (plus -5 more indirectly) thanks to [Michael Chatiskatzi](https://codegolf.stackexchange.com/users/90812/michael-chatiskatzi)*
```
def r:range(9),7-range(8);r|[8-.-r|"\(" "*.//1-.)"[:1]]|add
```
[Try it online!](https://tio.run/##yyr8/z8lNU2hyKooMS89VcNSU8dcF8K00LQuqom20NXTLapRitFQUlDS0tPXN9TV01SKtjKMja1JTEn5//9ffkFJZn5e8X/dojwA "jq – Try It Online")
### Explanation
The `-n` flag specifies that there is no input; the `-r` flag outputs the result strings, each on its own line, without quotes.
```
def r:         Define a helper function r
range(9),      which generates the numbers 0 through 8, followed by
7 - range(8);  the numbers 7 through 0
               Main program:
r |            Start with the results of r
[              For each of those numbers, put the following in a list:
 8 - . - r |    8, minus the current number, minus the results of calling r again
 "\(            For each of those numbers, interpolate the following into a string:
  " " * .        Try to repeat a space that many times
  //             and if the result is null (i.e. the number was less than 1),
  1 - .          subtract the number from 1 instead
 )"
 [:1]           Take the first character of each resulting string
] |            Take each resulting list of strings and
add            concatenate it together
```
To help visualize what's going on, here's what just the `r|[8-.-r]` part does:
```
[8,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8]
[7,6,5,4,3,2,1,0,-1,0,1,2,3,4,5,6,7]
[6,5,4,3,2,1,0,-1,-2,-1,0,1,2,3,4,5,6]
[5,4,3,2,1,0,-1,-2,-3,-2,-1,0,1,2,3,4,5]
[4,3,2,1,0,-1,-2,-3,-4,-3,-2,-1,0,1,2,3,4]
[3,2,1,0,-1,-2,-3,-4,-5,-4,-3,-2,-1,0,1,2,3]
[2,1,0,-1,-2,-3,-4,-5,-6,-5,-4,-3,-2,-1,0,1,2]
[1,0,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,1]
[0,-1,-2,-3,-4,-5,-6,-7,-8,-7,-6,-5,-4,-3,-2,-1,0]
[1,0,-1,-2,-3,-4,-5,-6,-7,-6,-5,-4,-3,-2,-1,0,1]
[2,1,0,-1,-2,-3,-4,-5,-6,-5,-4,-3,-2,-1,0,1,2]
[3,2,1,0,-1,-2,-3,-4,-5,-4,-3,-2,-1,0,1,2,3]
[4,3,2,1,0,-1,-2,-3,-4,-3,-2,-1,0,1,2,3,4]
[5,4,3,2,1,0,-1,-2,-3,-2,-1,0,1,2,3,4,5]
[6,5,4,3,2,1,0,-1,-2,-1,0,1,2,3,4,5,6]
[7,6,5,4,3,2,1,0,-1,0,1,2,3,4,5,6,7]
[8,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8]
```
Any number that's greater than 0 gets turned into that many spaces (and then trimmed back to a single space). The other numbers gets subtracted from 1 (turning 0 .. -8 into 1 .. 9) and stringified.
[Answer]
# Raku, ~~42~~ ~~41~~ ~~38~~ 35 chars
```
say " "x 9-$_,(1 x$_)²for 1…9…1
```
[Try it online!](https://tio.run/##K0gtyjH7/784sVJBSUGpQsFSVyVeR8NQoUIlXvPQprT8IgXDRw3LLIHY8P9/AA "Perl 6 – Try It Online")
[Answer]
# [JavaScript (V8)](https://v8.dev/), 67 bytes
```
z="9"
for(z of(s=n=>n<z?n+s(n+1)+n:z)(1))print("".padEnd(9-z)+s(1))
```
One byte less thanks to Fhuvi
[Try it online!](https://tio.run/##DcqxCoAgEADQva8IpzvEwC0ja@pDJBFsOEXF4X7enN/7XHf1LTE31fcx2AojlpAK8JoCVEv2opNvkhVIapR0MIJGzCVSAyG27PxDHoxinGfKGD8 "JavaScript (V8) – Try It Online")
### [JavaScript (V8)](https://v8.dev/), 68 bytes
```
s=n=>n<z?n+s(n+1)+n:z
z="9"
for(z of s(1))print("".padEnd(9-z)+s(1))
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNEts/j/v9g2z9Yuz6bKPk@7WCNP21BTO8@qiqvKVslSiSstv0ijSiE/TaFYw1BTs6AoM69EQ0lJryAxxTUvRcNSt0pTGyzz/z8A "JavaScript (V8) – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 71 bytes
For the records:
```
s=c(1:9,8:1);for(i in s)cat(rep(" ",9-i),s[0:i],s[(i-1):0],"\n",sep="")
```
[Try it online!](https://tio.run/##DcUxCsAgDADAr0imBCLoVlN8SetQxEIWK6b/t73l5lqWK0ZJvEmk/X4mqtPujOr14mwDwQEnr8R2BNHyh@ojSSgMZwe2NjIArfUB "R – Try It Online")
[Answer]
## Perl, 43+1
adding +1 for `-E` which is required for `say`
`say$"x(9-$_).(1x$_)**2for 1..9,reverse 1..8`
edit: shortened a bit
[Answer]
## Python, 65
```
for i in map(int,str(int('1'*9)**2)):print' '*(9-i),int('1'*i)**2
```
]