[Question]
      [
## Introduction:
Inspired by [this comment of *@MagicOctopusUrn*](https://codegolf.stackexchange.com/questions/129523/it-was-just-a-bug#comment326309_129549) on [*@Emigna*'s 05AB1E answer](https://codegolf.stackexchange.com/a/129549/52210) for my ["*It was just a bug*" challenge](https://codegolf.stackexchange.com/questions/129523/it-was-just-a-bug):
>
> `8F9ÝÀNð×ý}».∊` I done did made a spaceship maw! And I was all excited about suggesting a 12-byte edit. – [Magic Octopus Urn](https://codegolf.stackexchange.com/users/59376/magic-octopus-urn) Jul 17 '17 at 20:10
>
>
>
Which is a [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands) (legacy) program resulting in this:
```
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890
```
[Try it online.](https://tio.run/##AR8A4P8wNWFiMWX//zhGOcOdw4BOw7DDl8O9fcK7LuKIiv//)
## Challenge:
Input: A non-empty string
Output: From outwards going inwards, add one more space between each character every line, similar as done in the output above, equal to the `length - 1`. So for an input `1234567890` the output would actually be this instead:
```
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1        2        3        4        5        6        7        8        9        0
1         2         3         4         5         6         7         8         9         0
1        2        3        4        5        6        7        8        9        0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890
```
Why? The length of `1234567890` is `10`. So we start by outputting 10 lines: the first line without spaces; second with one space delimiter; third with two; etc. And then (without have the middle line with `length - 1` spaces duplicated), we go back to the initial input while going down.
## Challenge rules:
* Input is guaranteed to be non-empty (a length `>= 1`). (For single char inputs we simply output that character.)
* Any amount of trailing/leading spaces/newlines are allowed, as long as the output itself (wherever on the screen) is correct. (Empty line(s) in between output lines also isn't allowed.)
* Input will only contain printable ASCII characters excluding whitespaces (code-point range `[33, 126]`)
* I/O is flexible. Input may be taken as STDIN, argument, or function parameter. May be a list/array/stream of characters instead of string. Output may also be a list/array/stream of characters instead of strings; may be printed to STDOUT; returned as newline-delimited string; etc.
## General rules:
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
* [Standard rules apply](https://codegolf.meta.stackexchange.com/questions/2419/default-for-code-golf-program-function-or-snippet/2422#2422) for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
* [Default Loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden.
* If possible, please add a link with a test for your code.
* Also, adding an explanation for your answer is highly recommended.
## Test cases:
```
Input: @
Output:
@
Input: test
Output:
test
t e s t
t  e  s  t
t   e   s   t
t  e  s  t
t e s t
test
Input: ?!
Output:
?!
? !
?!
Input: Spaceship
Output:
Spaceship
S p a c e s h i p
S  p  a  c  e  s  h  i  p
S   p   a   c   e   s   h   i   p
S    p    a    c    e    s    h    i    p
S     p     a     c     e     s     h     i     p
S      p      a      c      e      s      h      i      p
S       p       a       c       e       s       h       i       p
S        p        a        c        e        s        h        i        p
S       p       a       c       e       s       h       i       p
S      p      a      c      e      s      h      i      p
S     p     a     c     e     s     h     i     p
S    p    a    c    e    s    h    i    p
S   p   a   c   e   s   h   i   p
S  p  a  c  e  s  h  i  p
S p a c e s h i p
Spaceship
Input: 05AB1E
Output:
05AB1E
0 5 A B 1 E
0  5  A  B  1  E
0   5   A   B   1   E
0    5    A    B    1    E
0     5     A     B     1     E
0    5    A    B    1    E
0   5   A   B   1   E
0  5  A  B  1  E
0 5 A B 1 E
05AB1E
Input: )}/\
Output:
)}/\
) } / \
)  }  /  \
)   }   /   \
)  }  /  \
) } / \
)}/\
```

[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~8~~ 6 bytes
Takes input as an array of characters, outputs an array of strings.
```
£qYçÃê
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.6&code=o3FZ58Pq&input=WyJTIiwicCIsImEiLCJjIiwiZSIsInMiLCJoIiwiaSIsInAiXQotUg==)
---
## Explanation
```
£          :Map each element at (0-based) index Y
 q         :  Join input with
  Yç       :   Space repeated Y times
    Ã      :End Map
     ê     :Palindromise
```
---
## Original, 8 bytes
I/O is a string. Uses the `-R` flag. Includes trailing spaces on each line.
```
¬£múYÄÃê
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.6&code=rKNt+lnEw+o=&input=IlNwYWNlc2hpcCIKLVI=)
### Explanation
```
             :Implicit input of string U
¬            :Split
 £           :Map each character at 0-based index Y
  m          :  Map original U
   ú         :    Right pad with spaces to length ...
    YÄ       :     Y+1
      Ã      :End map
       ê     :Palindromise
             :Implicitly join with newlines
```
[Answer]
# [R](https://www.r-project.org/), ~~105~~ ~~99~~ ~~85~~ ~~84~~ 79 bytes
-6 thanks to @Kevin Cruissen and @Giuseppe
-14 from changing to a regex based method
-1 thanks to @Giuseppe
-5 thanks to @digEmALl
```
function(w,n=nchar(w)-1)write(trimws(Map(gsub,"",strrep(" ",n-abs(n:-n)),w)),1)
```
[Try it online!](https://tio.run/##JcYxCsMwDEDRvadoNUlgD1lLQ3uBHsIxduMhqpEUdHwnkOHzvoz6iqPunK39GT3wzHlNgk5xIpdmBU3a5orf1PGn@xIAgppI6Qh3CBzTosjPyETBzyYaFeEDdDt5vC@tqF2nPeWia@tA4wA "R – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~10~~ 9 bytes
Saved 1 bytes thanks to *Adnan*
```
εINð×ý}û»
```
[Try it online!](https://tio.run/##yy9OTMpM/f//3FZPv8MbDk8/vLf28O5Du///j1YyUNJRMgViRyB2AmJDIHZVigUA "05AB1E – Try It Online")
**Explanation**
```
ε            # apply to each in input
 I           # push the input
  Nð×        # push <index> spaces
     ý       # merge the input on the spaces
      }      # end loop
       û     # palendromize
        »    # join on newlines
```
[Answer]
# JavaScript (ES6), 53 bytes
Takes input as an array of characters.
```
f=(s,p=i='',o=s.join(p)+`
`)=>s[++i]?o+f(s,p+' ')+o:o
```
[Try it online!](https://tio.run/##dcqxCsIwEADQvV@hXZJwNejgIpxVwS9wLIWGmGhKyQUv@PuR7mZ@bzZfw/YTUt5FerpSPEruEgYUoiNkPVOIMimYmknhmQeAMPYEfl0gNkIBnahYikyL0wu9pJeD1rq9tKNSzR/IjnPN@m1NHslYx@@QamF/vN4O91XLDw "JavaScript (Node.js) – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 10 bytes
```
Ｅθ⪫θ× κ‖Ｏ↓
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM3sUCjUEfBKz8zD0SHZOamFmsoKSjpKGRrAoE1V1BqWk5qcol/WWpRDlCtlUt@eZ6m9f//hkbGJqZm5haWBv91y3IA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
Ｅθ          Map over characters of input string
  ⪫θ        Join characters of input string using
    ×       a literal space repeated
      κ     current index number of times
            Implicitly print each result on its own line
       ‖Ｏ↓  Reflect vertically with overlap
```
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), 8 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
┐² ×＊］──
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JXUyNTEwJUIyJTIwJUQ3JXVGRjBBJXVGRjNEJXUyNTAwJXUyNTAw,i=U3BhY2VzaGlw,v=6)
The [7 byte](https://dzaima.github.io/Canvas/?u=JXUyNTEwJUIyJTIwJUQ3JXVGRjBBJXVGRjNEJXUyNTAw,i=JTIwQUJDJTVD,v=6) version was too good for this challenge..
[Answer]
# [Python 2](https://docs.python.org/2/), ~~72~~ ~~70~~ ~~68~~ ~~66~~ 65 bytes
-2 bytes thanks to Kevin Cruijssen
-3 bytes thanks to ovs
```
w=input();c=s=-1
while c:print(' '*~c).join(w);s*=w[:c]>'';c+=s|1
```
[Try it online!](https://tio.run/##BcFBCoAgEADAe6/wtmoU2FHZPhKdFkEjVHJDgujrNlMeDjktvTeMqdwslSOsOJmhhXh6QbZcMbEEAfojNR85JtmUqxrbZmlfARyNWF/TO7CvDD8 "Python 2 – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~54~~ 49 bytes
```
->a{(-(z=a.size-1)..z).map{|i|a*(?\s*(z-i.abs))}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6xWkNXo8o2Ua84sypV11BTT69KUy83saC6JrMmUUvDPqZYS6NKN1MvMalYU7O29n9BaUmxQlq0kqGRsYmpmbmFpYGSXnJGYlFxLBdMKrggMTm1OCOzAEPGXhEm9B8A "Ruby – Try It Online")
Takes input as an array of characters, outputs array of strings.
[Answer]
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/wiki/Commands), 9 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
εINúíJ}û»
```
Input as list of characters.
[Try it online](https://tio.run/##MzBNTDJM/f//3FZPv8O7Dq/1qj28@9Du//@jlTSVdJRqgVgfiGNilGIB) or [verify all test cases](https://tio.run/##MzBNTDJM/W/u5nl4QqjO/3NbI/wO7zq81qv28O5Du//rHNqm8z9ayVBJR8kIiI2B2ASITYHYDIjNgdgCiC2B2EAplitayQFMlgD5qUBcDMQlYBF7IEsRzAoGsgqAOBGIk5HUZQBxJlgOpMoAaosjEDsBMcgFrmAZTSCrFoj1gTgmRikWAA).
**Explanation:**
```
ε     }    # Map each character in the input to:
 I         #  Take the input
  Nú       #  Prepend each with the 0-indexed amount of spaces
           #   i.e. ["t","e","s","t"] & 3 → ["   t","   e","   s","   t"]
    í      #  Reverse each item
           #   i.e. ["   t","   e","   s","   t"] → ["t   ","e   ","s   ","t   "]
     J     #  Join them together to a single string
           #   i.e. ["t   ","e   ","s   ","t   "] → "t   e   s   t   "
       û»  # Palindromize the list, and join by newlines
           #  i.e. ["test","t e s t ","t  e  s  t  ","t   e   s   t   "]
           #   → "test\nt e s t \nt  e  s  t  \nt   e   s   t   \nt  e  s  t  \nt e s t \ntest"
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~60~~ 59 bytes
```
(init<>reverse).(scanl(?)<*>tail)
a?_=do u<-a;u:[' '|' '<u]
```
[Try it online!](https://tio.run/##DcyxDoIwEADQna@4jdYEPkAPGHCUhMTFRA25QMHG0pL26uS3Wxne@l4U3sqYpNfNeYYzMZWds05PIEBgLUFm2QwVPJLQVjPWXn2UD0qWIoxkjWgkHmombWRGzVBNDiIWdIrHew75d4fxmVbSdk9W2roBtshX9hcLJewzIiyKW2dZWQ6JVeDfOBtaQipubd//AQ "Haskell – Try It Online")
## Explanation
For a string (eg. `"abc"`) we apply first
```
scanl (?) <*> tail
```
which is the same as
```
\str -> scanl (?) str (tail str)
```
This repeatedly applies `(?)` (appends a space to each character in the range *[33..]*) to the `str` until there are that many strings as `str` has characters: `["abc","a b c ", "a b c "]`
Now we only need to concatenate the result (minus the last element) with its reversed counter part:
```
init<>reverse
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~66~~ 54 bytes
*-12 bytes thanks to mazzy*
```
0..($x=($a=$args).count-1)+$x..0|gu|%{$a-join(' '*$_)}
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfn/30BPT0OlwlZDJdFWJbEovVhTLzm/NK9E11BTW6VCT8@gJr20RrVaJVE3Kz8zT0NdQV1LJV6z9v///@ol6v/VU4G4WB3EBgA "PowerShell – Try It Online")
Takes input via splatting, which on TIO manifests as separate command-line arguments for each character.
We first set `$a=$args` as the input argument. Then we set `$x` equal to the `.count` of that array `-1`. We then need to loop through the letters to construct the spaceship. That's done by constructing a range from `0` to `$x`, then `$x` back down to `0`, then using `Get-Unique` to pull out just the appropriate range.
Each iteration, we take our input arguments and `-join` them together with the corresponding number of spaces. Each of those strings is left on the pipeline, and an implicit `Write-Output` gives us newlines for free when the program completes.
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~25~~ ~~22~~ 13 bytes
```
zZv"Gtz@he!1e
```
[Try it online!](https://tio.run/##y00syfn/vyqqTMm9pMohI1XRMPX/f3VDI2MTUzNzC0sDdQA "MATL – Try It Online")
Thanks to [Luis Mendo](https://codegolf.stackexchange.com/users/36398/luis-mendo) for suggesting a 5 byte golf, which then inspired me to shave off 4 more bytes!
Explanation, with example input `'abc'`:
```
         # Implicit input, 'abc'
z        # find number of nonzero elements (length of string)
         # stack: [3]
Zv       # symmetric range
         # stack: [[1 2 3 2 1]]
"        # begin for loop, iterating over [1 2 3 2 1] as the loop indices
G        # push input
         # stack: ['abc']
tz       # dup and push length
         # stack: ['abc', 3]
@        # push loop index, i (for example, 2)
         # stack: ['abc', 3, 2]
h        # horizontally concatenate
         # stack: ['abc', [3, 2]]
e!       # reshape to matrix of 3 rows and i columns, padding with spaces, and transpose
         # stack: [['abc';'   ';'   ']]
1e       # reshape to matrix of 1 row, leaving last value on stack
         # stack: ['a  b  c  ']
         # implicit end of for loop
         # implicit end of program, display stack contents
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~9~~ 8 bytes
*-1 byte from @Shaggy*
```
ÊÆ¬qXîÃê
```
---
```
ÊÆ¬qXîÃê        Full program, implicity input U
ÊÆ              Range from 0 to U length and map
  ¬             split U at ""
   qXîÃ         join U using " " times range current value
        ê       horizontal mirror
```
[Try it online!](https://tio.run/##y0osKPn//3DX4bZDawojDq873Hx41f//SsEFicmpxRmZBUoKukEA)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
jⱮLḶ⁶ẋƲŒḄ
```
[Try it online!](https://tio.run/##ATQAy/9qZWxsef//auKxrkzhuLbigbbhuovGssWS4biE/8OHKy/igqzFkuG5mP//U3BhY2VzaGlw "Jelly – Try It Online")
Returns a list of lines; output prettified over TIO.
[Answer]
# [Pyth](https://pyth.readthedocs.io), 12 bytes
Just my mandatory Pyth submission. I am quite proud of this so an explanation will likely come soon.
```
+P_=jRQ*L;_U
```
[Try it here!](https://pyth.herokuapp.com/?code=%2BP_%3DjRQ%2aL%3B_U&input=%22E%3DMC%5E2%22&debug=0)
```
+P_=jRQ_.e*d
```
[Try it here!](https://pyth.herokuapp.com/?code=j%2BP_%3DjRQ_.e%2ad&input=%22E%3DMC%5E2%22&debug=0)
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 10 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
Ç·9ƒù▌╘Ä┘e
```
[Run and debug it](https://staxlang.xyz/#p=80fa399f97ddd48ed965&i=%220123456789%22%0A%22%40%22%0A%22test%22%0A%22%3F%21%22%0A%22Spaceship%22%0A%2205AB1E%22&a=1&m=2)
Outputs with trailing whitespace on each line.
Explanation:
```
%R|pmx{]n(m Full program, unpacked, implicit input
%           Length of input
 R          1-based range
  |p        Palindromize
    m       Map:
     x{   m   Map over characters of input:
       ]        Character -> string
        n(      Right-pad to length given by outer map value
              Implicit flatten and output
```
[Answer]
# [Java (JDK 10)](http://jdk.java.net/), 115 bytes
```
s->{for(int l=s.length(),i=-l;++i<l;)System.out.printf(s.replaceAll(".","%-"+(i<0?l+i:l-i)+"s")+"%n",s.split(""));}
```
[Try it online!](https://tio.run/##rU/LTsMwELz3KxZLlWySWC1QHk3TUhAHDpxyRBxMmrRbHMeKnUqoyreHPEojgVQuWLK9OzP2zG7FTnjb1UeFqc5yC9u654VFyc/9wS8sKVRkMVMNGUlhDLwIVLAfAOjiXWIExgpbX7sMV5DWHA1tjmr9@gYiXxvWSgEeM2WKNM5nHTuHJGjxynjzfZLlFJUFGRguY7W2G8pcDDzpOw7OpM/CT2PjlGeF5bp@bhNqeB5rKaJ4KSUlnLhk6BGH4my0kA5OpYfMIYbUx1AR13CjJVpKCGN@Wfmt9TGnjY01EBySApDxxeXV5Prm9m5E3G/svi8bfd8tzvo61HUis0HdQ6PJ8mH8dOjLzrmZt3NvvaddAnYM8HNcqSh5VrqolQScVs38E1qvXeSkpmcTLqIo1pb@@S/5B7YcNLusvgA "Java (JDK 10) – Try It Online")
* -2 bytes thanks to [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)
[Answer]
# Oracle SQL, 115 bytes
Not a golfing language but...
```
SELECT TRIM(REGEXP_REPLACE(v,'(.)',LPAD('\1',1+LENGTH(v)-ABS(LEVEL-LENGTH(v)))))FROM t CONNECT BY LEVEL<2*LENGTH(v)
```
Assuming that the value is in column `v` of table `t`:
[SQL Fiddle](http://sqlfiddle.com/#!4/07659/13)
**Oracle 11g R2 Schema Setup**:
```
CREATE TABLE t ( v ) AS
  SELECT 'test' FROM DUAL;
```
**Query 1**:
```
SELECT TRIM(REGEXP_REPLACE(v,'(.)',LPAD('\1',1+LENGTH(v)-ABS(LEVEL-LENGTH(v)))))
FROM   t
CONNECT BY LEVEL<2*LENGTH(v)
```
**[Results](http://sqlfiddle.com/#!4/07659/13/0)**:
(SQLFiddle prints the values right-aligned in the column for some reason... there are no leading spaces)
```
| TRIM(REGEXP_REPLACE(V,'(.)',LPAD('\1',1+LENGTH(V)-ABS(LEVEL-LENGTH(V))))) |
|---------------------------------------------------------------------------|
|                                                                      test |
|                                                                   t e s t |
|                                                                t  e  s  t |
|                                                             t   e   s   t |
|                                                                t  e  s  t |
|                                                                   t e s t |
|                                                                      test |
```
[Answer]
## [Perl 5](https://www.perl.org/) + `-M5.010 -nlF`, 34 bytes
```
$,=$"x($#F-abs),say@F for-$#F..$#F
```
[Try it online!](https://tio.run/##K0gtyjH9/19Fx1ZFqUJDRdlNNzGpWFOnOLHSwU0hLb9IFyikpwck/v934CpJLS7hslfkCi5ITE4tzsgs4DIwdXQydOXSrNWP4TIwNDI2MTUzt7A0@JdfUJKZn1f8X9fXVM/A0OC/bl6OGwA "Perl 5 – Try It Online")
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), ~~25~~ 24 bytes
**Solution:**
```
,/'(1+a,1_|a:!#x)$\:+,x:
```
[Try it online!](https://tio.run/##y9bNz/7/X0dfXcNQO1HHML4m0UpRuUJTJcZKW6fCSim4IDE5tTgjs0Dp/38A "K (oK) – Try It Online")
**Explanation:**
Port of my [K4 solution](https://codegolf.stackexchange.com/a/171725/69200):
```
,/'(1+a,1_|a:!#x)$\:+,x: / the solution
                      x: / save input as x
                     ,   / enlist
                    +    / flip
                 $\:     / pad ($) right by each-left (\:)
   (            )        / do this together
              #x         / count length of input,           e.g. 3
             !           / range 0..length,                 e.g. 0 1 2
           a:            / save as a
          |              / reverse it,                      e.g. 2 1 0
        1_               / drop first,                      e.g. 1 0
      a,                 / join to a,                       e.g. 0 1 2 1 0
    1+                   / add 1,                           e.g. 1 2 3 2 1
,/'                      / flatten (,/) each (')
```
**Notes:**
* -1 byte thanks to ngn
[Answer]
# [Bash](https://www.gnu.org/software/bash/), ~~115~~, ~~109~~, ~~105~~, ~~100~~, ~~97~~, ~~96~~, ~~92~~, ~~91~~, ~~90~~, 82 bytes
-5 & -3 thanks to [Kevin Cruissen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)
-8 thanks to [roblogic](https://codegolf.stackexchange.com/users/15940/roblogic)
```
for((c=f=1;f;c-=2*(f>=${#1}),f+=c))
{ printf '%-'${f}'.c' `grep -o .<<<"$1"`
echo
}
```
[Try it online!](https://tio.run/##BcFBDsIgEADAO6/YVAyg0kSvgJ/wA8WVlV4KYb0R3o4z78h5zpbiB9hRaVpjoHB35NCGx0XTM8h@4mFudA1ojOhQ2378CNTZKtlpqBUVbN@WKtgCq/d@kbxsImEuYsz5qhET573@AQ "Bash – Try It Online")
---
Note that since the `\` is a shell escape char, the test case `)}/\` should be entered with an extra `\` like this: `)}/\\`.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `j`, 5 bytes
```
ż∞v↲∩
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2#WyJqIiwiIiwixbziiJ524oay4oipIiwiIiwiW1wiYVwiLFwiYlwiLFwiY1wiLFwiZFwiXSJd) -5 bytes thanks to lyxal.
```
ż     # range from 1 to length of input
 ∞    # Palindromised
  v↲  # For each character of the input, pad left by each of the above
    ∩ # Transpose
      # (j flag formats list of lines as a string)
```
[Answer]
# Zsh, ~~95~~ 77 bytes
[Try it online!](https://tio.run/##qyrO@J@moVn9P8tWJVpF2VDXMNY6Lb9IIVNBo1pXJUtPTyWrVjM1OSNfTQ0kXKGgoVKtUWxlpWlYq1lQlJlXkqagqgvRqVKdqaxbG1usoFLxH6SjlitNwdDI2MTUzNzC0gDIUdes1Y@JUQeyDEwdnQxdgYzggsTk1OKMzAIguyS1uASkyl4RpMThPwA)
~~[95 bytes](https://tio.run/##Fcq9DsIgGIXhvVfxWT8JDEUxcWkx/iRegaN1MA0EQmKbwtBIuHak25Nz3p83WVMWszvjVnSUOnlkjBApJQpC1GJDpccZLNAoOMeXa8Q7QUTHuUgsrt8CFCP1bcvKMs32GzTsGow2ecClU4MZU06Vhpqlfd/XRYfT7S4eBc/pMyhv7FQclA9rddmsyTX/AQ)~~
```
j=$[$#1-1];for i ({-$j..$j})echo&&for x (${(s::)1})printf %-$[$#1-${i#-}]s $x
```
Takes input from argument `$1`. Set `j` to `length-1`. Iterate `i` from `-j` to `j`. For each character `x` in the input string, print `x` and append a number of spaces equal to `length` minus the absolute value of `i`
[Answer]
# [Pascal (FPC)](https://www.freepascal.org/), ~~143~~ 135 bytes
```
var s:string;i,j,l:word;begin read(s);l:=length(s);repeat i:=i+1;for j:=1to l do write(s[j],'':l-abs(l-i)-1);writeln until i=l*2-1 end.
```
[Try it online!](https://tio.run/##HclBDsIgEADAr@ytRYsJHiG8wqPxQMu23WYDZEH7fIweJ1NCXQLrtSy9f4JAtbUJpc3RdExszyzRzbhRAsEQx6ocW8@Ytrb/IFgwNCDr6WrcmgUO603LwBAznEINx/o8XtMwWNZhriNrUtoo9z9O8E6NGMjz5a4NYIq33h8lLFh3Kl8 "Pascal (FPC) – Try It Online")
I will probably win only against Lenguage...
[Answer]
# PHP, ~~88~~ 89 bytes
```
for(;++$i<2*$e=count($a=str_split($argn));)echo join(str_pad("",~-$e-abs($i-$e)),$a),"\n";
```
requires PHP 5 or later for `str_split`. Run as pipe with `-nR` or [try it online](http://sandbox.onlinephpfunctions.com/code/115df30d29922cfe22c71b5920d73f2e4b0d5e18).
[Answer]
# [K4](https://kx.com/download/), 23 bytes
**Solution:**
```
,/'(1+a,1_|a:!#x)$\:$x:
```
**Example:**
```
q)k),/'(1+a,1_|a:!#x)$\:$x:"Spaceship"
"Spaceship"
"S p a c e s h i p "
"S  p  a  c  e  s  h  i  p  "
"S   p   a   c   e   s   h   i   p   "
"S    p    a    c    e    s    h    i    p    "
"S     p     a     c     e     s     h     i     p     "
"S      p      a      c      e      s      h      i      p      "
"S       p       a       c       e       s       h       i       p       "
"S        p        a        c        e        s        h        i        p        "
"S       p       a       c       e       s       h       i       p       "
"S      p      a      c      e      s      h      i      p      "
"S     p     a     c     e     s     h     i     p     "
"S    p    a    c    e    s    h    i    p    "
"S   p   a   c   e   s   h   i   p   "
"S  p  a  c  e  s  h  i  p  "
"S p a c e s h i p "
"Spaceship"
```
**Explanation:**
Has trailing whitespace on each line.
```
,/'(1+a,1_|a:!#x)$\:$x: / the solution
                     x: / save input as x,                 e.g. "abc"
                    $   / string,                          e.g. (,"a";,"b";,"c")
                 $\:    / pad ($) right by each-left (\:)
   (            )       / do this together
              #x        / count length of input,           e.g. 3
             !          / range 0..length,                 e.g. 0 1 2
           a:           / save as a
          |             / reverse it,                      e.g. 2 1 0
        1_              / drop first,                      e.g. 1 0
      a,                / join to a,                       e.g. 0 1 2 1 0
    1+                  / add 1,                           e.g. 1 2 3 2 1
,/'                     / flatten each
```
[Answer]
## C#, 113 105 98 bytes
```
s=>{for(int l=s.Length,i=-l;++i<l;)WriteLine(Join("",s.Select(c=>$"{c}".PadRight(i<0?l+i:l-i))));}
```
[Try it online!](https://tio.run/##bZFRT8IwEMff9ynOhYQtjAVUFBkD0fhiMCFi4oPxoZayXVI73BWMWfbZsWMgm3oPbe5//7v8euXU5kkqtmtCFcH8i7R4D6xq5k9RfRwk0kwjP1RuE0WJFP8X5zo1YmBZq/WbNDKXjAhmVmaBib13wjUmakg77wiWEG4pHGXLJHVQaZAh@VOhIh17GLZl0GrhUAbuc4paGCzh3CeoHNv2yJ8LKbh2eDhq2BnPbX/GFo8YxdrBYWcsWziQbXRNBPm2ADBgxbVKccO0OPBsElzAAzNDS6SXV2BpRO7OW5IXsWEpaEGaIAQlPo3rWAOwu6dn572Ly/5Vx/aq@nU9LSbUlfFJPZ@vGBcU46oud3qTm@5dRcv3rynC7E4wHoNTQBKgKkndH0MVFWD/h/5xpw37yTQMIKPcdoOaeenQL@Vvu9kHlH/vNMOmB/2OW@nJrfLMt98 "C# (.NET Core) – Try It Online")
[Answer]
# **[Scala](https://github.com/scala/scala)**, **82 bytes**
```
for(i<-(0 to a.size)union(-a.size to 0))println(a.map(_+" "*Math.abs(i)).mkString)
```
[Try it online](https://tio.run/##PY5NDoIwEIX3nGLS1YyGhjUREw/AyrgyxgxYtAotactCDGfHEozL7@X9@Zpbnm31VHWAkrWBTwJwUw10EZDd3edwcI7f52Nw2twvlMPJ6ADF39lYGwk5h9VCUOznxjrUuxQzCBZYej0qGoy2BtOVFj0j6mMitHFJdtzjdStAbEoOD8mVR00ku9evNVZaFH457IZWjYKSKZnmLw)
Scala has lot of shortcuts that are helping me here and that is quite readable!
[**Try Scala**](https://github.com/scala/scala)
[Answer]
# 8086 machine code, ~~56~~ 53 bytes
```
00000000  bf 35 01 57 ba 01 00 52  be 82 00 b3 ff ac 59 51  |.5.W...R......YQ|
00000010  aa 3c 0d 74 07 b0 20 e2  f7 43 eb f1 b0 0a aa 59  |.<.t.. ..C.....Y|
00000020  00 d1 e3 08 38 cb d6 08  c2 51 eb dc c6 05 24 5a  |....8....Q....$Z|
00000030  b4 09 cd 21 c3                                    |...!.|
00000035
```
Assembled from:
```
org 0x100
use16
        mov di, buffer
        push di
        mov dx, 1
        push dx
nextl:  mov si, 0x82
        mov bl, -1
nextc:  lodsb
        pop cx
        push cx
stor:   stosb
        cmp al, 0x0d
        je cr
        mov al, ' '
        loop stor
        inc bx
        jmp nextc
cr:     mov al, 0x0a
        stosb
        pop cx
        add cl, dl
        jcxz done
        cmp bl, cl
        salc
        or dl, al
        push cx
        jmp nextl
done:   mov [di], byte '$'
        pop dx
        mov ah, 0x09
        int 0x21
        ret
buffer:
```
Test case:
[![screenshot](https://i.stack.imgur.com/AheJe.png)](https://i.stack.imgur.com/AheJe.png)
[Answer]
## Haskell, ~~64~~ ~~60~~ 59 bytes
```
(""#)
a#s|l<-(:a)=<<s,w<-' ':a=l:[x|w<(' '<$s),x<-w#s++[l]]
```
[Try it online!](https://tio.run/##dYwxDoJAEEV7TzEZSIDAXoAMlYWNVtohMRNg1TjAxsFAwdldsbGz/O@9/BvroxXxFgo4@xgxSDYc6CJk4pyTgkiziUwEUc6F5OW8TBSvi0JNspnMFGiallJVvuN7v540wwYAOnaHC7jXeByf@x5CsICnVkf8yh9G/Nduh6Y1u0Es@ndtha/qTe3cBw "Haskell – Try It Online")
```
a#s                         -- take a string of spaces 'a' and the input string 's'
 |l<-(:a)=<<s               -- let 'l' be the current line, i.e. the spaces in 'a'
                            -- appended to each char in 's'
  w<-' ':a                  -- let 'w' be 'a' with an additional space
 =l                         -- return that 'l'
   :[   |w<(' '<$s)   ]     -- and, if 'w' is shorter than 's',
     x  ,x<-w#s++[l]        -- followed by a recursive call with 'w'
                            -- and by another copy of 'l'
(""#)                       -- start with an empty 'a'
```
]


[Question]
      [
You will be given 3 integers as input. The inputs may or may not be
 different from each other.
You have to output 1 if all three inputs
 are different from each other,
and 0 if any input is repeated more
 than once.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so make your code as short as possible!

[Answer]
# [Python 3](https://docs.python.org/3/), ~~23~~ ~~21~~ 20 bytes
```
lambda*a:len({*a})>2
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUSvRKic1T6NaK7FW087of0FRZl6JRpqGoY6RjrGmJhcy3wiJb6xjDJL/DwA "Python 3 – Try It Online")
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 7 bytes
```
*.Set>2
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPtfSy84tcTO6L81V3FipYKSSryCrZ1CtUKahkq8pkKtkkJafhGXhomOgqWOgqGmDpeGqY6CkY6CKYhpCBTSUTADMS10FIBqTEBMYx0FENK0/g8A "Perl 6 – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 13 bytes
A different solution to @Kirill by using [`mad()`](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/mad.html) for an unintended purpose!
```
mad(scan())>0
```
[Try it online!](https://tio.run/##PYxBCsIwEEX3PcWAmwyMwVSKCta7hHQiATuBJnUjPXtsKpW/eXwebyoH4HF@2RzkCclZUQhBUhgYLPhZXA5RCHycIHPaLBflzRJYHDe@3x2ltcZPLdyP/w/ddpfRDuoXx8epLI1Xhlo64wrtDoY66ipcaF2FGxm6YvkC "R – Try It Online")
[Answer]
# [R](https://www.r-project.org/), ~~24~~ ~~22~~ 20 bytes
```
all(table(scan())<2)
```
[Try it online!](https://tio.run/##PY3BCsIwEETv/YoFL1lYA4kUFerHxLiRQNxAm/YifntsKpW5PIbHzFgPwK85uRLlCZN3ohCiTPHB4CDM4kvMQhDyCIWnzfJZFpbI4rkLt91RWmt8t4Xh@O/Qb3V1Kani7onV7wIHi/XTBWXI0glXsDsY6qlvcKY1Da5k6IL1Cw "R – Try It Online")
Returns a boolean, but as folks have already discussed on the [Python answer](https://codegolf.stackexchange.com/a/171616/78274), this should be OK.
Thanks to digEmAll for saving 2 bytes.
[Answer]
# JavaScript, 22 bytes
If we can output boolean values then the last 2 bytes can be removed.
```
a=>new Set(a).size>2&1
```
[Try it online](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/R1i4vtVwhOLVEI1FTrzizKtXOSM3wf3J@XnF@TqpeTn66RjRXtKGOkY5xrA6IAWRCGEY6hjARECNWLzexQCNNU/M/AA)
For the same byte count, this works on arrays of any size but assumes the input will never contain a `0` and output is a boolean.
```
a=>!a[new Set(a).size]
```
[Try it online](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/R1k4xMTovtVwhOLVEI1FTrzizKjX2f3J@XnF@TqpeTn66RppGtKGOkY5xrKbmfwA)
[Answer]
# [Ruby](https://www.ruby-lang.org/), 16 bytes
```
->a{1-(a<=>a|a)}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6x2lBXI9HG1i6xJlGz9n9BaUmxQlp0tKGOkY5xbCwXgm@MxgfC2Nj/AA "Ruby – Try It Online")
[Answer]
# [Cubix](https://github.com/ETHproductions/cubix), ~~55~~ 25 bytes
*-29 thanks to Jo King*
```
O@O1u|@O@II-!/;I-!/;u^?-p
```
[Try it online!](https://tio.run/##Sy5Nyqz4/9/fwd@wtMbB38HTU1dR3xpMlMbZ6xb8/2@oYKRgBAA)
It should be possible to golf off quite a few bytes.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 2 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ÙQ
```
[Try it online](https://tio.run/##yy9OTMpM/f//8MzA//@jjXWMdUxiAQ) or [verify some more cases](https://tio.run/##yy9OTMpM/W/q5nl4gr2SwqO2SQpK9v8Pzwz8r/M/2ljHWMcklivaUMdIxxhI65rqmOoYGoBEjIx1oBjIM9DRtdAxiAUA).
**Explanation:**
```
Ù     # Uniquify the (implicit) input
 Q    # Check if it's still equal to the (implicit) input
```
[Answer]
# Mathematica, 13 bytes
```
Boole[E!=##]&
```
Pure function. Takes three integers as input and returns `0` or `1` as output. I know that this is rather similar to [David G. Stork's answer](https://codegolf.stackexchange.com/a/171658), but it exploits `SlotSequence` to shave off a byte (as compared to `Boole@*Unequal`).
[Answer]
# [J](http://jsoftware.com/), 4 bytes
```
-:~.
```
[Try it online!](https://tio.run/##y/qfVmyrp2CgYKVg8F/Xqk7vvyaXkp6CepqtnrqCjkKtlUJaMRdXanJGvkKagqGCkYIxjGME4vwHAA "J – Try It Online")
## Explanation:
Is the argument equal `-:` to itself after removing the duplicates `~.`
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), 4 bytes
```
3=#?
```
[Try it online!](https://tio.run/##y9bNz/7/39hW2d5QwUjB@P9/AA "K (oK) – Try It Online")
Does the count of the distinct elements equal 3?
[Answer]
# Japt `-N`, 3 bytes
```
eUâ
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.6&code=ZVXi&input=WzEsMiwzXQotTg==)
---
## Explanation
`Uâ` deduplicates the input and `e` tests if it's equal to the original.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~25~~ 26 bytes
```
f(a,b,c){a=a-b&&a-c&&b-c;}
```
[Try it online!](https://tio.run/##S9ZNT07@/z9NI1EnSSdZszrRNlE3SU0tUTdZTS1JN9m69n9mXolCbmJmnoYmVzUXZ0ERkJ@moaSaEpOnpKOQpmGoo2Cko2CsqWmNXdIQnyRQpyF2SROEsbX/AQ "C (gcc) – Try It Online")
[Answer]
# [brainfuck](https://esolangs.org/wiki/Brainfuck), 91 bytes
```
,>,>,[-<-<->>]>>+++++++[>+++++++<-]+<<<<[>]>>[<<<[-<->]<[>]>>->[>.<<<->>-]<+]<+[>>>[>]<-.>]
```
[Try it online!](https://tio.run/##NUsxCoBADHtQ7YG6lnykdFBBOAQHwffXlMMkQ5qk@7P1@3yPK3MC6WokEIAM@G9MQ4zwKr1MLWPcCkdjxlcNE8rBFWttiMx5WT8 "brainfuck – Try It Online")
### How it works
```
,>,>,                   'read input as A, B, and C
[-<-<->>]>>+            'compute A-C, B-C
++++++[>+++++++<-]+     'prepare output
<<<<[>]>>               'if A-C != 0 && B-C != 0
[
    <<<[-<->]           'compute A-B
    <[>]>>->            'if A-B != 0
    [>.<<<->>-]         'print 1
    <+
]
<+
[                       'else (this else is for both of the if statements, even though they are nested... wierd, I know)
    >>>[>]
    <-.>                'print 0
]
```
[Answer]
# Powershell, ~~27~~ 25 bytes
*-2 bytes thanks @AdmBorkBork*
```
+!(($args|group).Count-3)
```
Test script:
```
$f = {
+!(($args|group).Count-3)
}
&$f 1 2 3
&$f 3 2 1
&$f 2 1 3
&$f 2 2 3
&$f 2 1 1
&$f 2 1 2
```
Explanation:
```
    $args|group           # Group arguments
   (           ).Count    # Count of groups
  (                   -3) # is 0 if inputed integers are unique
 !                        # operator not converts int to boolean: true if integers are unique
+                         # converts boolean to int: 1 if integers are unique, otherwise 0
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 2 bytes
```
QƑ
```
[Try it online!](https://tio.run/##y0rNyan8/z/w2MT/h9sfNa35/z@aK9pQR0EXiA1idRSUFRJzchRK8zILS1O5og10FAwVdIxidbiiLXUUTIDKLIFssAaoeghQVihKLUhNLElNUcjMK0lNTy0q5orWNTQAmQshQEYAWSAUyxULAA "Jelly – Try It Online")
[Answer]
# Common Lisp, ~~25~~ 2 bytes
```
/=
```
[Try it online!](https://tio.run/##JcsxCoAwDAXQq/zN/EnSzh5GK0KhNKF6/1h0etMrrd4e0swclw3IjgOFqB2LSIIiEZ95qlMlcRrER@0PJNYt/kPGCw)
-23 bytes thanks to @ceilingcat!
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 3 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
Anonymous tacit prefix function. Takes list as argument.
```
∪≡⊢
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT////1HHqkedCx91Lfqf9qhtwqPevkd9Uz39H3U1H1pv/KhtIpAXHOQMJEM8PIP/pykYKhgpGHNBaEMA "APL (Dyalog Unicode) – Try It Online")
`∪` does the set of unique elements from the argument
`≡` match
`⊢` the unmodified argument?
[Answer]
# [Clean](https://github.com/Ourous/curated-clean-linux), 32 bytes
```
import Data.List
$l|hasDup l=0=1
```
[Try it online!](https://tio.run/##S85JTcz7n5ufUpqTqpCbmJn3PzO3IL@oRMElsSRRzyezuIRLJacmI7HYpbRAIcfWwNbwf3BJIlDeVkFFIdpQx1DHKPb/v@S0nMT04v@6nj7/XSrzEnMzkyGcgJzEkrT8olwA "Clean – Try It Online")
[Answer]
# [Attache](https://github.com/ConorOBrien-Foxx/Attache), 10 bytes
```
`==#Unique
```
[Try it online!](https://tio.run/##SywpSUzOSP2fpmBl@z/B1lY5NC@zsDT1v19qakpxtEpBQXJ6LFdAUWZeSUhqcYlzYnFqcXSajkI0lwIQRBvqKBjpKBjH6kC4BmCuJYxrqaNgoaNgAuNCFBsiyVoi6TU0AOqGEbFcsbH/AQ "Attache – Try It Online")
This is a fork of the operator ``==` and `Unique`, equivalent to:
```
{ _ == Unique[_] }
```
## Alternatives
`{#_=#Unique[_]}` (15 bytes)
`Any##Same=>Pairs@Sort` (21 bytes)
`Any@{`=&>_[[0'1,1'2,2'0]]}` (26 bytes)
`&${not(x=y or y=z or x=z)}` (26 bytes)
`&${x/=y and y/=z and x/=z}` (26 bytes)
`{Any!Same=>Chop&2!_[0'1'1'2'2'0]}` (33 bytes)
[Answer]
# Java 9, ~~43~~ 27 bytes
*thanks to @Olivier Grégoire*
```
(a,b,c)->a!=b&b!=c&a!=c?1:0
```
Previous attempt:
```
(a)->a[0]==a[1]||a[0]==a[2]||a[1]==a[2]?0:1
```
[Answer]
# [Red](http://www.red-lang.org), 21 bytes
```
func[b][b = unique b]
```
[Try it online!](https://tio.run/##K0pN@R@UmhIdy5Vm9T@tNC85Oik2OknBVqE0L7OwNFUhKfZ/QVFmXolCmkK0oYKRgnEsFwrfKPY/AA "Red – Try It Online")
[Answer]
# T-SQL, 39 bytes
```
SELECT IIF(a=b OR b=c OR c=a,0,1)FROM s
```
Input is taken as separate columns **a, b, c** from a pre-existing table **s**, [per our IO standards](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/5341#5341).
Tried a variation using `COUNT DISTINCT` from input taken as separate rows, but that was a couple bytes longer.
[Answer]
# Pyth, 3 bytes
```
s{I
```
Takes input as a list.
[Try it here](http://pyth.herokuapp.com/?code=s%7BI&input=%5B3%2C%201%2C%204%5D&debug=0)
### Explanation
```
s{I
 {IQ     Check if the (implicit) input is invariant under deduplication.
s        Cast to int.
```
If we're allowed to treat True and False as 1 and 0 (which they are under the hood in Pyth), we can drop the `s` to get down to 2 bytes.
[Answer]
# SmileBASIC, ~~25~~ 24 bytes
```
READ A,B,C?A-B&&B-C&&C-A
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 11 bytes
```
->a{a==a|a}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6xOtHWNrEmsfZ/QWlJsUJadLShjpGOcWwsF4JvjMYHwtjY/wA "Ruby – Try It Online")
Assuming we can return a boolean. Which everyone is doing nowadays.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 6 bytes
```
d?∧1|0
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/P8X@UcdywxqD//@jjXVMdUxi/0cBAA "Brachylog – Try It Online")
# short explanation
`d?` **d**eduplcates input an test if still equal to input(**?**)
`∧1` if true return 1
`|0` else return 0
[Answer]
# [><>](https://esolangs.org/wiki/Fish), ~~19~~ 17 bytes
-2 bytes by Jo King.
```
:{:{:{=}=}=++0=n;
```
[Try it online!](https://tio.run/##S8sszvj/36q2FoxsQVBb21Ajz/r///@6ZQqGcMIYAA "><> – Try It Online")
[Answer]
# [q](https://kx.com/download) 14 bytes
```
{x~distinct x}
```
Technically this solution will return '1b' or '0b', which is the way a boolean value is distinguished from a numeric type, though it retains all arithmetic functionality, and so is in essence a 1 or 0:
```
q)1b +35
36
```
To return 1 or 0 non-boolean you have the below, which takes the byte count to 21
```
{$[x~distinct x;1;0]}
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 67 bytes
```
f=a=>a.map((m,i)=>a.map((n,j)=>m==n&i!=j).every(z=>!z)).every(y=>y)
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/zTbR1i5RLzexQEMjVydTE87J08kCcnJtbfPUMhVtszT1UstSiyo1qmztFKs0YbxKW7tKzf/J@XnF@Tmpejn56RppGtGGOkAYq6nJhSFuhFPcGCT@HwA "JavaScript (Node.js) – Try It Online")
]


[Question]
      [
## Challenge
For a given positive integer \$n\$:
1. Repeat the following until \$n < 10\$ (until \$n\$ contains one digit).
2. Extract the last digit.
3. If the extracted digit is even (including 0) multiply the rest of the integer by \$2\$ and add \$1\$ ( \$2n+1\$ ). Then go back to `step 1` else move to `step 4`.
4. Divide the rest of the integer with the extracted digit (integer / digit) and add the remainder (integer % digit), that is your new \$n\$.
**Note**: In case `n < 10` at the very beginning obviously you don't move to step 2. Skip everything and print \$[n, 0]\$.
---
## Input
**n**: Positive integer.
---
## Output
**[o, r]**: `o`: the last `n`, `r`: number of repeats.
---
## Step-by-step example
For input `n = 61407`:
```
Repeat 1: 6140_7 -> 6140 / 7 = 877, 6140 % 7 = 1 => 877  + 1 = 878
Repeat 2: 87_8   -> 2 * 87 + 1 = 175 (even digit)
Repeat 3: 17_5   -> 17   / 5 = 3,   17   % 5 = 2 => 3    + 2 = 5 ( < 10, we are done )
```
The output is `[5, 3]` (last `n` is 5 and 3 steps repeats).
---
## Rules
There are really no rules or restrictions just assume `n > 0`. You can either print or return the output.

[Answer]
# [R](https://www.r-project.org/), 93 bytes
```
function(n,r=0,e=n%%10,d=(n-e)/10)"if"(n<10,c(n,r),"if"(e%%2,f(d%/%e+d%%e,r+1),f(d*2+1,r+1)))
```
[Try it online!](https://tio.run/##HcpLCoAwDADRuwiBxEbaiOjGnsYm0E2Eouevn@U8pnXL3W4/rno6OrecWLMDSOKS0SelKImGagP6/uLxTcQ/KMDMhgUiaCgAyi0IfTLOQf4g6oarLGmj/gA "R – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~78 77 76~~ 73 bytes
Recursive version. Saved 3 bytes thanks to [Jonathan Frech](https://codegolf.stackexchange.com/users/73111/jonathan-frech).
```
f=lambda n,r=0:n>9and f(n%2*sum(divmod(n/10,n%10))or n/10*2+1,-~r)or[n,r]
```
[Try it online!](https://tio.run/##FctLCoAgFADAq7gJnmakEkVBXSRaGCIJ@Qz7QJuubrWcxWz3sQRUKdl@1X42miCPvehwaDUaYgEzxfbTg3GXDwawlIJjJgWlIZJfTOWSF0/8PH53Slt0eICFWlaioTS9 "Python 2 – Try It Online")
# 74 bytes
Full program.
```
n,i=input(),0
while n>9:i+=1;r,R=n/10,n%10;n=[r-~r,r/R+r%R][R&1]
print n,i
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P08n0zYzr6C0RENTx4CrPCMzJ1Uhz87SKlPb1tC6SCfINk/f0EAnT9XQwDrPNrpIt65Ip0g/SLtINSg2OkjNMJaroCgzr0QBaMz//2aGJgbmAA "Python 2 – Try It Online")
[Answer]
# JavaScript (ES6), ~~62~~ 59 bytes
```
f=(n,r=0)=>(x=n/10|0)?f((n%=10)&1?x/n+x%n|0:x-~x,r+1):[n,r]
```
[Try it online!](https://tio.run/##DctBCoNADADA11gS1JpAURBSHyIeRN1SkaysIjmIX1@d@8z90W9D@K97rn6cYnQCmgUhlC@YaMF0EjYOQBNhwhc3VmhqiZ5UW35ZFlLGun1OFwevm1@m9@J/4KDkD1WI8QY "JavaScript (Node.js) – Try It Online")
### Commented
```
f = (n, r = 0) =>         // n = input, r = number of iterations
  (x = n / 10 | 0) ?      // x = floor(n / 10); if x is not equal to 0:
    f(                    //   do a recursive call:
      (n %= 10) & 1 ?     //     n = last digit; if odd:
        x / n + x % n | 0 //       use quotient + remainder of x / n
      :                   //     else:
        x - ~x,           //       use x - (-x - 1) = x + x + 1 = 2x + 1
      r + 1               //     increment the number of iterations
    )                     //   end of recursive call
  :                       // else:
    [n, r]                //   return [ final_result, iterations ]
```
[Answer]
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b), 19 bytes
```
[DgD–#ÁćDÈi\·>ë‰O]?
```
Explanation:
```
[                     Start infinite loop
 DgD                  Get the length
    –#                If it's 1, print the loop index and break.
      ÁćD             Extract: "hello" -> "hell", "o"
         Èi           if even,
           \·>        Double and increment
              ë       else,
               ‰O     Divmod, and sum the result (div and mod).
                 ]    End if statement & infinite loop
                  ?   Print
```
[Try it online!](https://tio.run/##ASsA1P8wNWFiMWX//1tEZ0TigJMjw4HEh0TDiGlcwrc@w6vigLBPXT///zYxNDA3 "05AB1E (legacy) – Try It Online")
[Answer]
# [Julia 1.0](http://julialang.org/), ~~81~~ ~~80~~ 79 bytes
```
function d(n,c=0)l,r=n÷10,n%10;n>9 ? d(r%2<1 ? 2l+1 : l÷r+l%r,c+1) : [n,c]end
```
[Try it online!](https://tio.run/##PY7tCoIwFIZv5UAIG4q4ZR9W1oVE4JpTFuNMTkrdmRfgha35p3/v837A@5qcVeIbQjehHq1HaBlmui64y6jGZRZFhokoznit4BZDSuRFRCVdKuAEbpkpdQllOhU88j2OHwbbMJDF0SFrmZDbcrc/HCvOYQOdJ3jaHmJqekNv@JAaVvLQRL@B/xGT9/laZZ3SoyerHFuplJzz8AM "Julia 1.0 – Try It Online")
* -1 (thanks Mr. Xcoder)
[Answer]
# [Ruby](https://www.ruby-lang.org/), 61 bytes
```
f=->n,r=0{n>9?(a=n%10;n/=10;f[a%2<1?n-~n:n/a+n%a,r+1]):[n,r]}
```
[Try it online!](https://tio.run/##KypNqvz/P81W1y5Pp8jWoDrPztJeI9E2T9XQwDpP3xZIpkUnqhrZGNrn6dblWeXpJ2rnqSbqFGkbxmpaRQP1xNb@L1BIizYzNDEwj@UCMS1j/wMA "Ruby – Try It Online")
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 79 bytes
```
(\d+)[02468]$
;$.(_2*$1*
(\d+)(.)
$2*_;$1*
}`(_+);(\1)*(_*)
;$.($3$#2*
^;*
$.&;
```
[Try it online!](https://tio.run/##HcoxCoAwDEDRPdcwSJJCaWtRIUexWgUdXBzE1bNX7Prfv4/nvDZfCqXd8ORC7McZQdFSDoJeoAJZBgyS9S/vStmwUvIslIXrjR02QWBRAbStltL76IYP "Retina – Try It Online") Explanation:
```
(\d+)[02468]$
;$.(_2*$1*
```
If the last digit is even, multiply the rest of the integer by 2 and add 1. This always results in an odd number, so we don't need to repeat this.
```
(\d+)(.)
$2*_;$1*
```
Split off the last digit and convert to unary for the divmod.
```
}`(_+);(\1)*(_*)
;$.($3$#2*
```
Divide the rest of the integer by the last digit and add the remainder. Then repeat the whole program until there's only one digit left.
```
^;*
$.&;
```
Count the number of operations performed.
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 61 bytes
```
{tail kv $_,{$1%2??$0/$1+$0%$1+|0!!$0*2+1}...{!/(.+)(.)/}: 2}
```
[Try it online!](https://tio.run/##DcTRCkAwFADQX7mrS5vp7m6JIvkUeaCEElKaffs4D2cfj7WM2wPpBG301zCvsNyAfe7RJq7rkA1ajZz8vywEcua0DUTkhZGklSRlQg0uxHN4YJKlLbhSTfwA "Perl 6 – Try It Online")
Returns (r, o).
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 43 bytes
Feels messy and bad but here it is anyway
```
;0{hl1&|⟨{h⟨k{t%₂0&h×₂+₁|⟨÷+%⟩}t⟩}↰₁{t+₁}⟩}
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/39qgOiPHUK3m0fwV1RlAIru6RPVRU5OBWsbh6UBa@1FTI0ju8HZt1UfzV9aWgIhHbRuAwtUlIMlakMD//2aGJgbm/6MA "Brachylog – Try It Online")
[Answer]
**VBA (Excel), ~~145?, 142, 139,~~ 123 bytes**
Condensed Form:
```
Sub t(n)
While n>10
e=Right(n, 1)
n=Left(n,Len(n)-1)
If e Mod 2=0Then n=n*2+1 Else n=Int(n/e)+n Mod e
c=c+1
wend
Debug.?n;c
End Sub
```
Expanded (with comments)
```
Sub test(n) 'For a given positive integer n
    'Repeat the following until n<10
    While n > 10
        'Extract the last digit
        e = Right(n, 1)
        'Remove the last digit
        n = Left(n, Len(n) - 1)
        'If the extracted digit is even...
        If e Mod 2 = 0 Then
            'Multiply the rest of the integer by 2 and add 1
            n = n * 2 + 1
        Else
            'Divide the rest of the integer with the extracted digit and add the remainder
            n = Int(n / e) + n Mod e
        End If
        'Keep count
        c = c + 1
    'End the Loop
    Wend
    'Give the output
    Debug.Print (n ; c)
End Sub
```
(Do excuse me, as this is my first post. I will happily edit! Right now, it looks like to test it you open the Immediate Window and type 't n' where n is your number to test :D)
[Answer]
# [Swift 4](https://developer.apple.com/swift/), ~~112~~ ~~104~~ ~~100~~ 93 bytes
```
var n=Int(readLine()!)!,r=0,p=n%10;while n>9{n=[n/10*2+1,n/10/p+n/10%p][n%2];r+=1};print(n,r)
```
[Try it online!](https://tio.run/##Ky7PTCsx@f@/LLFIIc/WM69Eoyg1McUnMy9VQ1NRU1GnyNZAp8A2T9XQwLo8IzMnVSHPzrI6zzY6T9/QQMtI21AHxNAv0AZRqgWx0XmqRrHWRdq2hrXWBUWZQOPydIo0//83MzQxMP8PAA "Swift 4 – Try It Online")
Prints `n r`
* -7 (Thanks to Mr. Xcoder)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 19 bytes
```
dd/Sɗ:Ḥ‘ɗḂ?Ƭ⁵ṖṖṪ,LƊ
```
[Try it online!](https://tio.run/##y0rNyan8/z8lRT/45HSrhzuWPGqYcXL6wx1N9sfWPGrc@nDnNDBapeNzrOv///9mhiYG5gA "Jelly – Try It Online")
[Answer]
# Common Lisp, 145 bytes
A function which takes the `n` provided and returns the list `(n r)`. Lisp syntax is fun.
```
(defun f(n &optional(r 0))(if(< n 10)`(,n,r)(let((h(floor n 10))(l(mod n 10)))(if(evenp l)(f(1+(* 2 h))(1+ r))(f(+(mod h l)(floor h l))(1+ r)))))
```
[Answer]
## Haskell, 78 bytes
```
f n|n<10=(n,0)|(d,m)<-divMod n 10=(1+)<$>f(last$2*d+1:[div d m+mod d m|odd n])
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P00hrybPxtDAViNPx0CzRiNFJ1fTRjcls8w3P0UhTwEkYaitaaNil6aRk1hcomKklaJtaBUNVKCQopCrnQtUBaRr8lOAqmM1/@cmZuYp2Cqk5HMpKBQUZeaVKKgopCmYGZoYmKOImP8HAA "Haskell – Try It Online")
[Answer]
# 8086 machine code, 35 bytes
```
00000000  31 c9 31 d2 bb 0a 00 f7  f3 85 c0 74 14 f6 c2 01  |1.1........t....|
00000010  75 05 d1 e0 40 e2 eb 89  d3 88 f2 f7 f3 01 d0 e2  |u...@...........|
00000020  e1 f7 d9                                          |...|
00000023
```
Input: `AX = n`
Output: `DX = o`, `CX = r`
Assembled from:
```
        xor cx, cx
next:   xor dx, dx
        mov bx, 10
        div bx
        test ax, ax
        jz done
        test dl, 1
        jnz odd
        shl ax, 1
        inc ax
        loop next
odd:    mov bx, dx
        mov dl, dh
        div bx
        add ax, dx
        loop next
done:   neg cx
```
[Answer]
# [Red](http://www.red-lang.org), 131 bytes
```
func[n][s: 0 while[n > 9][r: do form take/last t: form n t: do t
n: either r % 2 = 1[t / r +(t % r)][2 * t + 1]s: s + 1]print[n s]]
```
[Try it online!](https://tio.run/##JY0xDsIwEAT7vGIbJCBF4giBsASPoD1dEWFbsQhOdD7E842Bbna2GPGu3LwjboIt4ZXulJiyRY/3FGdPCVecmcTCLQiLPKHjw3fzmBVq/yZ9qd7aJAsfdfICwQYDLjCk6Opqt1qN7JgG7KFoYbhm8g9WiUlrKjOXgKM59KfyAQ "Red – Try It Online")
## More readable:
```
f: func [ n ] [
    s: 0
    while [ n > 9 ] [
        r: do form take/last t: form n
        t: do t
        n: either r % 2 = 1
            [ t / r + (t % r) ]
            [ 2 * t + 1 ]
        s: s + 1
    ]
    print [ n s ]
]
```
]


[Question]
      [
As I'm applying for some jobs whose job advert doesn't state the salary, I imagined a particularly evil interviewer that would give the candidate the possibility to decide their own salary ...by "golfing" it!
So it goes simply like that:
>
> Without using numbers, write a code that outputs the annual salary you'd like to be offered.
>
>
>
However, being able to write concise code is a cornerstone of this company. So they have implemented a very tight seniority ladder where
>
> employers that write code that is *b* bytes long can earn a maximum of ($1'000'000) ¬∑ *b*-0.75.
>
>
>
we are looking at (these are the integer parts, just for display reasons):
```
   1 byte  ‚Üí $1'000'000       15 bytes ‚Üí $131'199
   2 bytes ‚Üí   $594'603       20 bytes ‚Üí $105'737
   3 bytes ‚Üí   $438'691       30 bytes ‚Üí  $78'011
   4 bytes ‚Üí   $353'553       40 bytes ‚Üí  $62'871
  10 bytes ‚Üí   $177'827       50 bytes ‚Üí  $53'182
```
### The challenge
Write a program or function that takes no input and outputs a text containing a dollar sign (`$`, U+0024) and a decimal representation of a number (integer or real).
* Your code cannot contain the characters `0123456789`.
In the output:
* There may optionally be a single space between the dollar sign and the number.
* Trailing and leading white spaces and new lines are acceptable, but any other output is forbidden.
* The number must be expressed as a decimal number using only the characters `0123456789.`. This excludes the use of scientific notation.
* Any number of decimal places are allowed.
**An entry is valid if** the value it outputs is not greater than ($1'000'000) ¬∑ *b*-0.75, where *b* is the byte length of the source code.
### Example output (the quotes should not be output)
```
"$ 428000"            good if code is not longer than 3 bytes
"$321023.32"          good if code is not longer than 4 bytes
"  $ 22155.0"         good if code is not longer than 160 bytes
"$ 92367.15 \n"       good if code is not longer than 23 bytes
"300000 $"            bad
" lorem $ 550612.89"  bad
"¬£109824"             bad
"$ -273256.21"        bad
"$2.448E5"            bad
```
### The score
The value you output is your score! (Highest salary wins, of course.)
---
## Leaderboard
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
```
# Language Name, $X (Y bytes)
```
where `X` is your salary and `Y` is the size of your submission. (The `Y bytes` can be anywhere in your answer.) If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:
```
# Ruby, <s>$111111.111... (18 bytes)</s> <s>$111999 (17 bytes)</s> $123456 (16 bytes)
```
You can also make the language name a link, which will then show up in the leaderboard snippet:
```
# [><>](http://esolangs.org/wiki/Fish), $126,126 (13 bytes)
```
```
var QUESTION_ID=171168,OVERRIDE_USER=77736;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body.replace(/<(s|strike)>.*?<\/\1>/g,"");s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a1=r.match(SCORE_REG),a2=r.match(LANG_REG),a3=r.match(BYTES_REG);a1&&a2&&e.push({user:getAuthorName(s),size:a3?+a3[1]:0,score:+a1[1].replace(/[^\d.]/g,""),lang:a2[1],rawlang:(/<a/.test(a2[1])?jQuery(a2[1]).text():a2[1]).toLowerCase(),link:s.share_link})}),e.sort(function(e,s){var r=e.score,a=s.score;return a-r});var s={},r=1,a=null,n=1;e.forEach(function(e){e.score!=a&&(n=r),a=e.score,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.lang).replace("{{SCORE}}","$"+e.score.toFixed(2)).replace("{{SIZE}}",e.size||"?").replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);s[e.rawlang]=s[e.rawlang]||e});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){var r=e.rawlang,a=s.rawlang;return r>a?1:r<a?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SCORE}}","$"+o.score.toFixed(2)).replace("{{SIZE}}",o.size||"?").replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var LANG_REG=/<h\d>\s*((?:[^\n,](?!\s*\(?\d+\s*bytes))*[^\s,:-])/,BYTES_REG=/(\d+)\s*(?:<a[^>]+>|<\/a>)?\s*bytes/i,SCORE_REG=/\$\s*([\d',]+\.?\d*)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```
```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:520px;float:left}table thead{font-weight:700}table td{padding:5px}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Score</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td><td>Size</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SCORE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SCORE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```
---
Edit: (rounded) maximum allowed score per byte count, for a quicker reference - [text here](https://tio.run/##HcFBCoAgEADAryySsIqKi0jRob8EZe1FQ7z0@g2aed5xt5pESuvAwBX6Xq8TyVEmsz6d60Cl0wHebzBpWgLFojSyo/izbC36GOZsjBH5AA):
[![enter image description here](https://i.stack.imgur.com/HpQNN.png)](https://i.stack.imgur.com/HpQNN.png)

[Answer]
# Python 2, $65536 (34 bytes)
An answer using mathematical operators:
```
t=True;t+=t;t<<=t;print"$",t**t>>t
```
## How it works
```
t=True;    # True evaluates to 1
t+=t;      # 1 + 1 = 2
t<<=t;     # 2 << 2 = 8
print"$",  # Python 2's print statement doesn't need parentheses or whitespace
t**t>>t    # 8 ** 8 = 16777216
           # 16777216 >> 8 = 65536
```
[Answer]
# [GS2](https://github.com/nooodl/gs2), 4 bytes ($256256)
```
‚Ä¢$‚ñº‚ñº
```
[Try it online!](https://tio.run/##Sy82@v//UcMilUfT9jxqm/D/PwA "GS2 ‚Äì Try It Online")
Just thought I'd add this as there were no 4 byte solutions. There are probably better solutions of 4 bytes, it'd be interesting to see what the highest is.
Explanation:
```
‚Ä¢$    Push a '$' character on the stack
  ‚ñº   Push 256 on the stack
   ‚ñº  Push 256 on the stack
```
[Answer]
# [SQLite](https://www.sqlite.org/), 26 bytes, $86850
```
select'$'||unicode('ïçÇ')
```
[Try it online!](https://tio.run/##Ky7MySxJ/f@/ODUnNblEXUW9pqY0LzM5PyVVQ/3D1N4mdc3//wE "SQLite ‚Äì Try It Online")
Inspired by T-SQL @BradC answer
[Answer]
# FreeBASIC, $124095 (16 bytes)
```
?"$" &&hc &&hfff
```
prints
```
$124095
```
? means print
&h is the hex prefix
& connects parts together
Tested using FreeBASIC online
[Answer]
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/), ~~$104857~~ $125000 (16 bytes)
```
." $"char û°à .
```
[Try it online!](https://tio.run/##S8svKsnQTU8DUf//6ykpqCglZyQWKXyYt7BDQe//fwA "Forth (gforth) ‚Äì Try It Online")
[Answer]
## Excel, ~~10~~ 16 bytes, ~~$177827~~ $125000
`="$"&ROW()`
Not sure if this is a valid entry. It returns $ following the current row number. So if you put it on row ~~177827~~ 125000, it will return ~~$177827~~`$125000`
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), 12 bytes, $155052
```
'$'t';I'hpVh
```
(Maximum for 12 bytes is $155100)
Explanation:
```
'$'t';I'hpVh
'$'             String literal
   t            Duplicate
    ';I'        String literal, product of which results in highest bound by $_max / 38
        h       Horizontal concat
         p      Product (implicitly converts to int)
          V     Convert to string
           h    Horizontal concat
```
[Answer]
# [Common Lisp](http://www.clisp.org/), 59 bytes $46974
```
(defun x()(format nil "~{~a~}"(list'"$"(char-code #\Îùæ))))
```
[Try it online!](https://tio.run/##S87JLC74/18jJTWtNE@hQkNTIy2/KDexRCEvM0dBqa66LrGuVkkDqKhEXUlFSSM5I7FINzk/JVVBOeb13H2aQPBfo6AoM69EQaMCyAYA "Common Lisp ‚Äì Try It Online")
[Answer]
## JavaScript, 31 bytes, $74088
```
(x='*'.charCodeAt())=>'$'+x*x*x
```
The `*` asterisk character decimal code point `42` cubed is `74088` [Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@1@jwlZdS10vOSOxyBko5Fiioalpa6euoq5doQWE/5Pz84rzc1L1cvLTNdKAcv8B)
[Answer]
# [C (clang)](http://clang.llvm.org/), $70560 (34 bytes)
```
main(){printf("$%d",'*'*'*'*'(');}
```
[Try it online!](https://tio.run/##S9ZNzknMS///PzcxM09Ds7qgKDOvJE1DSUU1RUlHXQsKNdQ1rWv//wcA "C (clang) ‚Äì Try It Online")
[Answer]
# [Z80Golf](https://github.com/lynn/z80golf), $123456 (12 bytes)
```
00000000: 0606 3e24 ffc6 0c3c ff10 fc76            ..>$...<...v
```
[Try it online!](https://tio.run/##q7IwSM/PSfv/3wAKrBQMzAzMFIxTjUwU0tKSzRQMko2TgSxDA4W0ZHMzBSSgp2enoqenZwPEZf//AwA "Z80Golf ‚Äì Try It Online")
Assembly:
```
ld b, 6 ; loop 6 times
ld a, 24h ; '$' char
rst 38h
add 0Ch ; 30h='0' char
loop:
	inc a
	rst 38h ; putchar
	djnz loop
halt
```
[Try it online!](https://tio.run/##LY5BCoMwEEXX5hR/UXCjJNRSSmtXpd32DKMRYolGnLRY6d3TKC4GhnmP/6ciNqEmj7K8Px/4QbrBS2Juusp@8/mkZBziDlI3H8letz1yhzyq06SD1agyHHGBdW6Ii2@7hkU8U4b9wUSQ7lLUhkYxskdxMoK0hrotqFDmmqoNLwFnkbR9DRLJJkdpePuVJ/rVz2uNMGR9iP@GPw "Bash ‚Äì Try It Online")
[Answer]
# Oracle SQL, 54 bytes ($50200)
```
select '$'||to_number(rawtohex('‚îÄ‚Üë'),'xxxx') from dual
```
Symbols must have codes 196 and 24 because 196 \* 256 + 24 = 52000.
Symbols may differ for different code pages, demonstrated result tested for code page 437.
```
SQL> select '$'||to_number(rawtohex('‚îÄ‚Üë'),'xxxx') from dual
  2  /
'$'||TO_NUMBER(RAWTOHEX('‚îÄ‚Üë'),'XXXX')
-----------------------------------------
$50200
SQL> exit;
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\Windows\System32>chcp
Active code page: 437
```
# Oracle SQL, 44 bytes ($57343)
```
select '$'||ascii(unistr('\DFFF')) from dual
```
Max allowed number in this case is 58534 but the max one in HEX without digits is DFFF.
```
SQL> select '$'||ascii(unistr('\DFFF')) from dual
  2  /
'$'||A
------
$57343
```
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), $279936 (5 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md))
```
$ÔºñÔºóÔºæÔºã
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JTI0JXVGRjE2JXVGRjE3JXVGRjNFJXVGRjBC,v=8)
Note that the Ôºñ & Ôºó there are full-width characters, not ASCII numbers.
[Answer]
# Ink, $56789, 43 bytes
```
$<>
-(o)~temp q=o+o+o+o
-(t){t+q}{t<=q:->t}
```
[Try it online!](https://tio.run/##y8zL/v9fxcaOS1cjX7OuJDW3QKHQNl8bDIFiJZrVJdqFtdUlNraFVrp2JbX//wMA "ink ‚Äì Try It Online")
# Explained
```
$<>               // Print a dollar sign and do not print a trailing newline.
-(o)              // Create a gather, and give it the label o. This creates a variable o, which keeps track of how many times this gather has been reached
                  // It is currently set to 1, and it will stay that way.
~temp q=o+o+o+o   // Create a variable q, containing the number 4.
-(t)              // Another label, another variable.
{t+q}             // print t + q, that is to say t + 4
{t<=q:->t}        // If t is not greater than q, jump to the gather labelled t
                  // (this automatically increments the t variable)
```
# Alternative solution: $66666, 31 bytes, but
I did find a better solution, but I don't like it, because it abuses a bug in the interpreter:
```
-(n){|}$<>
-(t){t<n+n:{n+n}->t}
```
[Try it online!](https://tio.run/##y8zL/v9fVyNPs7qmVsXGjktXo0SzusQmTzvPqhpI1OraldT@/w8A "ink ‚Äì Try It Online")
The `{|}` is a sequence - it outputs one string (the empty string, in this case) the first time the line is reached, and another string (which in this case is also the empty string) every subsequent time the line is reached.
This might not seem useful here, since we never return to that line. But in the current version of Inklecate, when a sequence occurs immediately after a labelled gather, the gather's readcount increments three times rather than the usual one.
This makes it easy to produce a 3, which we then use to print the number 6 five times.
[Answer]
# [Befunge-93 (FBBI)](https://github.com/catseye/FBBI), $209024 (8 bytes)
```
",**.@G$
```
[Try it online!](https://tio.run/##S0pNK81LT9W1NNZNS0rK/P9fSUdLS8/BXeX/fwA "Befunge-93 (FBBI) ‚Äì Try It Online")
[Answer]
# [Runic Enchantments](https://github.com/Draco18s/RunicEnchantments/tree/Console), 6 bytes, $255000
Thought I'd hit up a few challenges with the language I wrote a few days ago. TIO doesn't yet have an interpreter for it (coming soon I hope). Character set and execution is similar to [><>](https://esolangs.org/wiki/Fish), but with an extended set of available commands, multiple IPs, and IP "energy" (some commands--such as `o` (sort)--require/consume mana and IPs with 0 mana are terminated).
```
'√øY'$@
```
[Try it online!](https://tio.run/##KyrNy0z@/1/98P5IdRWH//8B "Runic Enchantments ‚Äì Try It Online")
### Explanation
```
>          Implicit entry (single line programs only; does not occupy a cell)
 '√ø        push √ø as a character
   Y       multiply by 1000 (implicit conversion to 255)
    '$     push $ as a character
      @    print entire stack and terminate the IP
```
An earlier attempt was `e|$$$':*` (push 15, reflect, push 15, multiply, duplicate, push `$`, print, print, print, (print: empty stack: IP terminated), resulting in $196196 however I realized that I could use `@` instead of `$$` which got me `f|@$':*` with a score of `$225225`, but further experimentation showed that I could get down to *six* characters starting from `Pbp'$@` (push PI, push 11, power, push `$`, print and terminate), which was `c5p'$@`. But that ran into the issue of no digit characters allowed (ironically, both entries resulted in higher outputs).
## 2 IPs (because the language can): $148642 (max $155100)
```
>e'$@
FFm\>
```
[Try it Online](https://tio.run/##KyrNy0z@/98uVV3FgcvNLTfG7v9/AA)
### Explanation
This will be a little hard to follow, but hopefully it makes sense. Instruction pointers wrap when they reach the edge of the program.
```
>
    >      Entry points (each IP begins with 10 mana)
----------------------
 e         Push 14
F          Fizzle
----------------------
  '        Enable single character read mode
 F         Fizzle
----------------------
   $       Push '$'
  m        Push current mana (8)
----------------------
    @      Print stack ($14) and terminate
   /       Reflect upwards
----------------------
   $       Pop and print (8)

----------------------

   /       Reflect right
----------------------
   $
mFF/       Push current mana (6), fizzle twice, reflect up
           At this point the IP is in a loop. It will terminate
           when it pushes a (2) and fizzles twice to end up with 0 mana
```
[Answer]
# [Cascade](https://github.com/GuyJoKing/Cascade), $177827, 10 bytes
```
^´ö£$
 #"
```
[Try it online!](https://tio.run/##S04sTk5MSf3/P@7D6lmLVbgUlJX@/wcA "Cascade ‚Äì Try It Online")
I'm lucky here in that `´ö£` counts as a letter variable, which allows me to fetch its ordinal value, with the cost that it is a multi-byte character.
[Answer]
# Go, $84426
```
func f(){print("$",'îßä')}
```
The character in the single quotes is the Unicode character with code point `U+149CA`, encoded as 4 bytes in UTF-8. The Unicode standard does not currently assign it a value, but it is nevertheless valid to place it in Go source code, earning me only 18 cents below the maximum for 27 bytes. If you prefer, the character `U+14646 Anatolian Hieroglyph A530` is the nearest that is assigned, though it only gets me $83526.
[Answer]
# [Wren](https://github.com/munificent/wren), 34 bytes, $71021
Wren's verbosity ruined the game.
```
System.printAll(["$"]+"
".bytes)
```
[Try it online!](https://tio.run/##Ky9Kzfv/P7iyuCQ1V6@gKDOvxDEnRyNaSUUpVluJnUtUSS@psiS1WPP/fwA "Wren ‚Äì Try It Online")
[Answer]
# [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), $ 65,025 (37 bytes)
```
[S S S T    S S T   S S N
_Push_36_$][T   N
S S _Print_as_character][S S S T    T   T   T   T   T   T   T   N
_Push_255][S N
S _Duplicate_255][T S S N
_Multiply][T    N
S T _Print_as_integer]
```
Letters `S` (space), `T` (tab), and `N` (new-line) added as highlighting only.
`[..._some_action]` added as explanation only.
[Try it online](https://tio.run/##K8/ILEktLkhMTv3/X0FBgROMuDi5FECAEwq4FLhgwpz//wMA) (with raw spaces, tabs and new-lines only).
**Explanation in pseudo-code:**
```
Print '$' to STDOUT
Integer n = 255 * 255
Print n to STDOUT
```
---
I've created [this 05AB1E program](https://tio.run/##ZVLBbtNAEL3zFU8WIgjSKkUqVamC2gsnEAhV4kA5rO2JdxRn190dJ/KhR34A8SGIT2hvHPilMLtJ2lSsZEvreW/evHn20ZRM6/XJ8WQyef8ZKD710cKg5ShgB7GEYFxD@JoxYxx9K66e/Plx9/329w3SKT66dsCcqMvoeN2bQHD9oqQQFXv49yc2p3jHrs6gGQftvzRtT1hZriw4QkIvdsDMhzdQHiDYES/NnPa6HwTvJUPK5j9IS64RCz8DS0TJzoQBUQK7JlNenb7cUi7qWm9JMBO9vgIcVRRj4pSDkE7l0SlXMHo6OkPdd4RnWPStcKe2xergWqWGwhmM2tuAWWDuC1l2cnhy/HxxP6kCtHOS7fxKZQ9SPQNf3/56sR3ww4OMEZ0HR@OUgT4ZOZzvzF@ocGWpmus2KdtgGUW8nWYFdixs2s2@E/Nmx/tiyWGlefh@m0xcmLYlDedRjlixrjRv14QmlTsfI5etEox@GjaJybScYs9i3HVJeeXtVN4tKcjWvnkcD0xj2I331kgm/Rqu5iXXvQ42FFfr9T8) to generate this largest binary value that is still within the allowed salary based on the byte-count of the other necessary Whitespace commands, which resulted in `11111111` (255).
[Answer]
# [Deadfish~](https://github.com/TryItOnline/deadfish-), $101111 (21 bytes)
```
iisiisc{{d}}iiisioioo
```
[Try it online!](https://tio.run/##S0lNTEnLLM7Q/f8/M7MYiJKrq1NqazNBnPzM/Pz//wE "Deadfish~ ‚Äì Try It Online")
[Answer]
# [Knight](https://github.com/knight-lang/knight-lang), ~~$126126 (13 bytes)~~ $127127 (15 bytes)
```
O++"$"=d+A"~"Td
```
[Try it online!](https://tio.run/##rVltU9tIEv5s/4rBOSyNLCey4Kq2bMsukoUUdQSykNx@AF8QsgyqlWWfJMNyhP3rue6eF41sk7vcLR8sa@bpnu5nerp7TNS9jaJvr5IsSlfTeFiU02Tx@m7UNEfS5KY2FJWPy3gNlCfZbW2oTOYCM41nSRazNGXpIrulj6Ye/XT6@QPrVa8Xn86ZX73@/eCc7VevR6fv2E/V6/ln1qvARycXBvb084kB/Xz64eDib3bBmY0fbfZH769czx5cwLJiMroLc@bwSsBEga1axWjE9qu508NfcTKDSfLoK8Pvw@EaBpchDLoJmDTlCKxh3p6dnRAIP8bkZB99Mww5fy8AIG/Yeh@mq5jzy2zCm03yA3blchKctw7PjuxvZ51O6y@tYNo5aP3R@jT9xmG0NRBAB5BxOGcBigyaTdC7DPMitjl7ajaSrGTJoNmAUVrDZc5slUUwQsIRvJfzpVsss0t/Ejx5rvcMOhoJqCM8PD0cePMG1SdL9nCXlHGxDKO42YDvaWzDOIjbwgyXta7Kq@xqdpWzp@fLic37r1qcTGkkM2ZrawNmvbI4EyrU6A6MXmUw3OmIEbCzEadFbA48C3Oiuzj6jc0WOctW85s4L6Q9zE6KaXKblEorrI7u9FztkXg6rOexDnOk5Z0OZ11meRYsgZYmnOVxucozpqJCiFFgDNZtuA/zJLxJY2UFGJEuHuLcjmA9ZQj7@pUp4yJ6i4iILxaX9CRbXE@Cngt7FOjhNevwnMl4BEg2XS1t3FImOe0yeNs0WJz6QmgTZlxZVmVTyxKbBsLggTaKgRLIEvAdLFuGRcnKuxiUhXkJYLkBjmIUNzTi6Iky1jg8LxoLnz1OG92oyCDzMXTLZJGB2Rix3gRMixQjxWq5RMK5iio1YtJvxh/QbpCNOlQoLzOIY8hYGLnScsHKJ0sfazFwhAOYvfqYtdBMFWSU8ISrNtqNpoZpuojsfc/tcXQQh7UT5GC2StMwfzQdrfbn3Niej5a2jBaU8qtsTZqW6OESMils8/Tg8O276192Tn4@Mxw21d4kW/X6m3p3aorfH1@8oLGMc1IZZlP2z1WoXlHtvbnE3uYSgoD3lubieAsXJLxfF65jnilV5qsMd2ggs65TLgpb5Uo6ABDaZRIxmr1ZzS79/Ym0Q2x0m9KDNqBYwrEqZzZAwf/dNJ22VN6hquOiknUFcCi0AlHPxPo13JD19up@ovMYi2PWKvNV3IIY1OMYkjA@CyGD4EQLI6tVkYB@ou@y8BAdX94uFinM3NQZeNHXyq3vOeT8uEemmTcbZqZoY/an2ghBWy7S1DZNdZnnQoX4H0zONkzGKvzh4OOpi7VYBBq8Hl/2PM@DcAJX4FW9Fcm/4i8lw8fAiFHDW2QA3lz88OlzL@ipko4ZDqs6PujTF489ABwdnxw6bAbJcdDQoS3XwzQchUs3jTPqAAyuVF8kOINz9xIZ64JYm7C0YcGxE@oloBYPiYsBFJUEJ3XeiObLtR0gkpJJlUKQpmSCyxQPSRnd2Q4ws9FGAUdM/kVYp6wDq89wFQEIkFBsxCAL8zY5JdXLVrAWsnxAVbhCUL9Z5li6qOW8nPCnKsyggaLcLhY@h4XrunPIeDZve7/P8K9CfgQkaBUc3cZlCt2i3aa9bOMOYYmcJhkfJDPbpv3EhiC6y9EWF@KUc7HNgTfYais8OLUBYr1DsZ7oHDEbSEIGyl4kSebOysq3lT8Cr2feVTMoaVKsMdeAwWiA@AuWi2Wc2cbCbitvUasAVgVzUSkhHgPf2/@JxmVzYYuOZAamT9EpaOEgZF3s7wAOvQO94RqwtAovGwZZJ6BWCE8sILmkG/TQWkQ1anAC5ps9S0Vj5ckv4En8O7RxeNo3/Nyp7TpdCnYwk20ATzbCA1ZJ67wY8J@tvuwTtwSyznyyArVOqS22sQZxVYRGo31eNZYb6VCJXlBzaO8WKFg/DJvCQCe0Pua6kEl5q4KqCSwvcZhJtS@VMFmzzB2QuUWycFaxgAdDXHyQNLGfNepYu003qW4XoRPR5l5Ru91QZu2@dgqwx4Y3ztRRyw3zV2Whdl/HhOj1hEEdbRDlSciXmJIxtIztEd10o77b4lqKaOj7mYolX@w59r90GMQGEAqH8ZQHykufbw/VKCzVQ3advU5FE1ffUReHbtSlZylzhPSruxGdRrRjq163Vwg51e5sYWG9PG/hwdngQezrNhbmW1xzCBOYSkgAapBNGTKwruCSh6BBt0v6JFFUMtc3WjBa1k7/m@8S82Y7MbvfFdrdLvQPYrPmkLg60JhvejmQtAvWA9btaZYJC9T34Jx1e3DGeibY/0H0ENJjDRsECKV1@2rEU5QT0f7Ik1z7nNoVJyD@m@sHgibJFbgjUILFEgPf8cpwF@exVbBsAT10kpZJxh7CR@CNTRdwJy3j2zgHmeUii7MyCfEWASd5wR5idhfexwCUihBesnmYrSB8Hl/jKHp3g4wDFcREsUpL/NGAFtcJT0G6JkYtuUaZKacha@pR38tI72VDNGxYQ3l0Pw9TrI2P4HU2TeMpu67MvtZanvCbaMyMRSpnRqis21XvnOANCXUM0591HhxSsK4VPkx6tbwY1LPimJmHf2geAxTtyx/c2kwAxqzWKNKgy4xsiDo8IalKri/qAGJ3Aqg2Rhc0gkOJobWYLvpsHs@jJYZZxkbX4//XldGf4MpIubKzxZdA@iJdGb/Mvlh1i8k4PWY1gK8RviqgO9vsrF60eyrzmAq0ee0q/aEv22rD2JSUqUTLf/1v5GUOMtRo@YHVN9G1NncdG1RZtz79wxcZ1dtWNxnENWq3GZ0KCYMaJ0FN2kiTKIGITkeLCZN/BffEr15mo1nzjpm9ixQ7rnftCDXkx35/z6DlvbgyBEaH1TEL0OYdKZMXD1efhb1aQ3shiF5TOlgvef62krfHdR/ga@l9GvwPDREahk/cikg3/7odMnsjHzzEVTs9bJKoQRDxLybpQYiOPAmw@jSehZAkwTPVYSYZTCZT@hEpjEooU9ZuZGHPiSOcvXCLRWW6BkI3KH9ImIdJhs0qC/PbyCWljgPf7zn@XEX3S/z/je2RNfVr3PO3fwM)
Output:
```
$127127
```
Now that `ASCII` is standard, this becomes very easy.
```
O++"$"=d+A"~"Td
         A"~"   # ASCII value of "~", 126
        +    T  # Add TRUE (coerced to 1) to get 127
      =d        # Assign 127 to d
  +"$"          # Prepend "$", this stringifies d
 +            d # Append 127 again to get "$127127"
O               # Output
```
* $1001: `+A"~"T`
[Answer]
# [Squire](https://github.com/sampersand/squire), ~~$77777 (27 bytes)~~ $80000 (28 bytes)
```
proclaim("$"+arabic(M*LXXX))
```
Outputeth:
```
$80000
```
True Squire programmers needeth not the characters `0123456789`, rather, they useth Roman numerals.
```
# Proclaim to ye standard output...
proclaim(
    # A dollar sign,
    "$"
    # and M*LXXX in thy strange Arabic numeral system,
    # what one might write as 80000
    + arabic(M*LXXX)
)
```
* $2223: `M*LXXX` should've been obvious lol
---
# [Squire](https://github.com/sampersand/squire) without Roman numerals (commit `93d3bf1`), $55555 (38 bytes)
```
proclaim("$"+arabic(x=length(""+n))*x)
```
Sampersand doubteth my first solution, claiming that Roman numerals art "cheating". I contemplated catapulting him, but nay, I wouldns't want to slay the creator of this divine language.
Abuseth a blunder in commit `93d3bf1`, where the program counteth `"" + null` as `V` characters long.
```
# Proclaimeth to ye standard output...
proclaim(
   # A dollar sign,
   "$"
   # appended to the Arabic numeral 5
   +arabic(
     # Since n naught exist, it evaluateth to "null".
     # Assigneth the length of this to "x"
     # blunder: "null" art IV characters, not V, you jest
     x = length("" + n)
   )
   # Multiplieth the string "5" V times to get "55555"
   * x
   # Reward: "$55555"
)
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~$161051 (11 bytes)~~ $192450 (9 bytes)
```
+\$C"ÀÆ«Ç
```
Performs an integer conversion (via `C`) on two two-byte characters (ÀÆ, code point `0x2EE`, and «Ç, code point `0x1C2`), resulting in a final value of `0x2EFC2`, i.e. $192450, the best integer score for this byte-count.
**Old answer:**
```
+\$^hT/ThhZ
```
Prepends a '$' sign to the result of 11^5.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `·π°`, 6 bytes, $260847
```
\$¬ª‚üë¬¨«é
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyLhuaEiLCIiLCJcXCTCu+KfkcKsx44iLCIiLCIiXQ==)
[Answer]
# [Zsh](https://www.zsh.org/), $138166 (14 bytes)
```
<<<\$$[##°Æ∂]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m724qjhjwYKlpSVpuhbrbGxsYlRUopWVPyxcty0WIgiVg6kBAA)
°Æ∂ is the Unicode character with codepoint 138166. This is the maximum integer score for 14 bytes.
[Answer]
# [Rattle](https://github.com/DRH001/Rattle), $ 180180 (9 bytes)
```
$|bn*~/bb
```
[Try it Online!](https://www.drh001.com/rattle/?flags=&code=%24%7Cbn*%7E%2Fbb&inputs=)
# Explanation
```
$|          take "$" as a variable
  b         add "$" to print buffer
   n        get ASCII value of "$" (36)
    *~      multiply by 10 ("~" acts as a zero here)
      /     divide by 2
       bb   add to print buffer twice
            (implicit output of "$180180")
```
[Answer]
# [Trilangle](https://github.com/bbrk24/Trilangle), $177827 (10 bytes)
```
"$´ö£o!@"
```
That CJK character is U+2B6A3, and 0x2b6a3 is 177827 in decimal.
Try it on [the online interpreter](https://bbrk24.github.io/Trilangle/#%22%24%F0%AB%9A%A3o!%40%22)!
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), $192169 (9 bytes)
```
s+\$CM"√Ä¬©
```
[Try it online!](https://tio.run/##K6gsyfj/v1g7RsXZV@lww6GV//8DAA "Pyth ‚Äì Try It Online")
[Answer]
# [Julia 1.0](http://julialang.org/), $101937 (~~23~~ 21 bytes)
```
print(:$,Int('ò∏±'))
```
[Try it online!](https://tio.run/##yyrNyUw0rPj/v6AoM69Ew0pFxxNIqX@YsWOjuqbm//8A "Julia 1.0 ‚Äì Try It Online")
To obtain the magic value, I rounded down the maximum score for a solution with this byte count, then converted it to a `Char`.
-2 bytes thanks to amelies: print `:$` instead of `'/$'`
]


[Question]
      [
Given a non-negative integer, \$n\$, yield the \$(n^2)^\text{th } n\$-gonal number.
### Further Detail:
The \$x\$-gonal numbers, or *polygonal numbers*, are also known as the *two-dimensional figurate numbers*.
Many people will be familiar with the triangular numbers, these are the \$3\$-gonal numbers:
$$F(3,n)=\sum\_{i=1}^{n}(i)=\frac{n(n+1)}{2}$$
The triangular numbers are [OEIS A000217](https://oeis.org/A000217):
```
0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, ...
```
Probably even more will be familiar with the square numbers, these are the \$4\$-gonal numbers:
$$F(4,n)=\sum\_{i=1}^{n}(2i-1)=n^{2}$$
The square numbers are [OEIS A000290](https://oeis.org/A000290):
```
0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, ...
```
In general the \$k^\text{th }x\$-gonal number is the number of pebbles required to iteratively build up an \$x\$-sided polygon by adding pebbles to \$x-2\$ of the sides, here are a few formulae:
\begin{align}
F(x,k)&=\sum\_{i=1}^{k}\left(1+\sum\_{j=2}^{i}(x-2)\right) \\
&=\frac{k^2(x-2)-k(x-4)}{2} \\
&=\frac{k(k-1)}{2}(x-2)+k\\
&=(x-3)\sum\_{i=1}^{k-1}(i)+\sum\_{i=1}^{k}(i)\\
&=(x-2)(k-1)+1+F(x,k-1)
\end{align}
I'm sure there are plenty more.
Note that the last one is recursive but that \$F(x,0)=0\$.
### The challenge
...is to golf code for \$G(n)=F(n,n^2)\$ for non-negative \$n\$.
i.e. Given a non-negative integer, \$n\$, yield the \$(n^2)^\text{th } n\$-gonal number.
This is not (currently) in the OEIS:
```
0, 1, 4, 45, 256, 925, 2556, 5929, 12160, 22761, 39700, 65461, 103104, 156325, 229516, 327825, 457216, 624529, 837540, 1105021, ...
```
### Notes
You may yield a list of these numbers up to and including the required one if preferred.
For example, given an input of `5` you may yield either:
* the integer `925`, or
* the list `[0, 1, 4, 45, 256, 925]`
* ...**but not `[0, 1, 4, 45, 256]` or `[1, 4, 45, 256, 925]`**
Results may also be results of floating point calculation and may deviate as such, so long as infinite precision floating point arithmetic would yield correct results.
---
Win by creating the shortest code in bytes in a language. The overall winner will be the shortest across all languages, but please don't let golfing languages dissuade you from entering in your favourite language - the primary goals are to challenge yourself and have fun!

[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 19 bytes
```
#(4-#-2#^2+#^3)#/2&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2ar8V9Zw0RXWddIOc5IWznOWFNZ30jtv6Y1V0BRZl5JtLKCrp1CmoNyrJq@Q1BiXnpqtIGOoUHsfwA "Wolfram Language (Mathematica) – Try It Online")
Just a golfy version of the second formula.
## With [`PolygonalNumber`](http://reference.wolfram.com/language/ref/PolygonalNumber.html) built-in, 23 bytes
```
PolygonalNumber[#,#^2]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2ar8T8gP6cyPT8vMcevNDcptShaWUc5zihW7b@mNVdAUWZeSbSygq6dQpqDcqyavkNQYl56arSBjqFB7H8A "Wolfram Language (Mathematica) – Try It Online")
As expected, the Mathematica built-in is longer than the golfed version.
[Answer]
# [Neim](https://github.com/okx-code/Neim), 2 bytes
```
ᛦℙ
```
[Try it online!](https://tio.run/##y0vNzP3//@HsZY9aZv7/bwoA "Neim – Try It Online")
¯\\_(ツ)\_/¯ First Neim answer, right tool for the job. By the way, the advice I give on my *About me* page still holds for my own posts: [Don't upvote trivial solutions, please](https://codegolf.meta.stackexchange.com/questions/10127/how-can-we-help-users-who-are-put-off-by-the-use-of-golfing-languages/10132#10132).
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
²Ḷ×_2$‘S
```
[Try it online!](https://tio.run/##y0rNyan8///Qpoc7th2eHm@k8qhhRvD///8tAQ "Jelly – Try It Online")
In short, it generates the range \$[0,1,2,\dots,(n-1)^2]\$, multiplies every integer in that range with \$n-2\$, increments each of them (to avoid adding \$n^2\$ at the end, saving 1 byte), then sums the resulting list.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 4 bytes
```
nsÅU
```
[Try it online!](https://tio.run/##yy9OTMpM/W9ocHhuWaW9koKunYKSfWXl/7ziw62h/21r/wMA "05AB1E – Try It Online")
[Answer]
# Pyth, ~~14~~ 9 bytes
```
smh*d-Q2*
```
[Try it online!](https://tio.run/##K6gsyfj/vzg3QytFN9BI6/9/UwA)
[Answer]
# [Python 2](https://docs.python.org/2/), ~~31~~ 30 bytes
```
lambda k:(k*k*(k-2)-k+4)*k*k/2
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSHbSiNbK1tLI1vXSFM3W9tEE8jJ1gcqyS9SyFTIzFMoSsxLT9UwNNC04lIoKMrMK1HI1EnTyNT8DwA "Python 2 – Try It Online")
---
Saved:
* -1 byte, thanks to joH1
[Answer]
# JavaScript (ES7), 26 bytes
```
n=>n**4*(n-2)-n*n*(n-4)>>1
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/P1i5PS8tESyNP10hTN08rD8Qy0bSzM/yfnJ9XnJ@TqpeTn66RpmGpqfkfAA "JavaScript (Node.js) – Try It Online")
---
# Recursive (ES6), 33 bytes
A quick attempt from mobile. Not really optimized for \$(n,n^2)\$.
```
x=>(g=k=>k&&(x-2)*--k-~g(k))(x*x)
```
[Try it online!](https://tio.run/##BcExDoAgDADA35CWpA5uDuUvBIFoCTViTCe/jndnfONI93E91HXPs/A0DlBZOIhzYLSiJxL6KggimDecSfvQlpemFQpsiPMH "JavaScript (Node.js) – Try It Online")
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 17 bytes
```
Ｉ⊘↨⟦¹±²±¹¦⁴¦⁰¦⁰⟧Ｎ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwyMxpyw1RcMpsThVI9pQR8EvNT2xJFXDSBPONAQyTXQUDIAoVkfBM6@gtMSvNDcptUhDEwSs//83/a9blgMA "Charcoal – Try It Online") Link is to verbose version of code. Explanation: Uses the second formula expanded into the polynomial \$ \frac{1}{2} ( x^5 - 2x^4 - x^3 + 4x^2 ) \$ which is calculated by treating it as an arbitrary base conversion before halving and casting to string for implicit output.
[Answer]
# [cQuents](https://github.com/stestoltz/cQuents/tree/cquents-0), 20 bytes
```
$0:$$+$$/2($$-1)($-2
```
[Try it online!](https://tio.run/##Sy4sTc0rKf7/X8XASkVFW0VF30hDRUXXUFNDRdfo/38A "cQuents 0 – Try It Online")
## Explanation
```
$0                      Zero indexing
  :                     Mode: sequence (output nth term)
                        Each term equals:
   $$+                    index * index +
      $$/2                index * index / 2 *
          ($$-1)($-2      (index * index - 1) * (index - 2
                    )    ) implicit
```
[Answer]
# [Physica](https://github.com/Mr-Xcoder/Physica), 25 bytes
```
->n:(n^4-n^2)/2*(n-2)+n^2
```
[Try it online!](https://tio.run/##K8ioLM5MTvzvZhvzX9cuz0ojL85ENy/OSFPfSEsjT9dIUxvI@R9QlJlXEu0W7ZlXUFqiEhv73xIA "Physica – Try It Online")
---
```
->n:n^2*(4-n-2*n^2+n^3)/2
```
[Try it online!](https://tio.run/##K8ioLM5MTvzvZhvzX9cuzyovzkhLw0Q3T9dIC8jUzosz1tQ3@h9QlJlXEu0W7ZlXUFqiEhv73xIA "Physica – Try It Online")
---
```
->n:n^5/2-n^4-n^3/2+2*n*n
```
[Try it online!](https://tio.run/##K8ioLM5MTvzvZhvzX9cuzyovzlTfSDcvzgSIjfWNtI208rTy/gcUZeaVRLtFe@YVlJaoxMb@twQA "Physica – Try It Online") | **[Try all of them at once as a test suite!](https://tio.run/##K8ioLM5MTvz/31HBVkHXLs9KIy/ORDcvzkhT30hLI0/XSFMbyOFygsoC2VoaQHldIy0gEyhlDFTH5QyXNdU30oUYYKxvpA1UpJXHxeWWX6TgqfCoo0Mh2kDhUcMyBUODWCsuzoCizLyS6OCSomjPWL2crNLikmjjWGsFJaBRStYKIHFHB7iMoWksRMwJi5gziljs//8A "Physica – Try It Online")**
[Answer]
# [Clean](https://github.com/Ourous/curated-clean-linux), 38 bytes
```
import StdEnv
$x=x^2*(x^3/2-x^2-x/2+2)
```
[Try it online!](https://tio.run/##S85JTcz7n5ufUpqTqpCbmJn3PzO3IL@oRCG4JMU1r4xLpcK2Is5IS6MizljfSBfI1K3QN9I20vwfXJIIVGWroKJg@v9fclpOYnrxf11Pn/8ulXmJuZnJxQA "Clean – Try It Online")
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 17 bytes
```
×⍨×2+×⍨-⍨.5×*∘3-⊢
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24TD0x/1rjg83UgbzNAFYj3Tw9O1HnXMMNZ91LUIqEjh0IpHvZsNDQA "APL (Dyalog Unicode) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~11~~ 10 bytes
```
²µ½_2×’H×+
```
[Try it online!](https://tio.run/##ASoA1f9qZWxsef//wrLCtcK9XzLDl@KAmUjDlyv/UjA7w4figqw7IkAkR///MTA "Jelly – Try It Online")
Uses the formula \$F(x,k)=\frac{k(k-1)}{2}(x-2)+k\$ as given in the challenge.
[Answer]
# [MATL](https://github.com/lmendo/MATL), 9 bytes
```
U:qG2-*Qs
```
[Try it online!](https://tio.run/##y00syfn/P9Sq0N1IVyuw@P9/cwA "MATL – Try It Online")
This uses [Mr. Xcoder's Jelly approach](https://codegolf.stackexchange.com/a/171257/36398).
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), 23 bytes
```
{((x-2)*k%2%k-1)+k:x*x}
```
[Try it online!](https://tio.run/##y9bNz/7/P82qWkOjQtdIUytb1Ug1W9dQUzvbqkKrovZ/mrqikcF/AA "K (oK) – Try It Online")
Prefix function; implementation of the second formula: \$\frac{k(k-1)}{2}(x-2)+k\$
### How:
```
{((x-2)*k%2%k-1)+k:x*x} # Main function, argument x.
                 k:x*x  # def k = n²
 ((x-2)*k%2%k-1)+       # calculate k + (((k/2)/(k-1))*(x-2))
```
[Answer]
# Haskell (31 bytes)
```
g k=(k*k*k*k*(k-2)-k*k*(k-4))/2
```
[Answer]
# [Haskell](https://www.haskell.org/), 27 bytes
```
f k=(k^4*(k-2)-k^2*(k-4))/2
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P00h21YjO85ESyNb10hTNzvOCMQy0dTUN/qfm5iZp2CrUFCUmVeioKKQpmBo8B8A "Haskell – Try It Online")
My first attempt at golfing in Haskell, basically same as almost any answer :
Nothing worth explaining here.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~60~~ ~~36~~ 34 bytes
-24 bytes thanks to [Jonathan Allan](https://codegolf.stackexchange.com/questions/171235/find-the-leftn2-right-textth-n-gonal-number#comment413854_171460)
-2 bytes by factorizing again an `n*n` expression.
```
g(n){return(n*n*(n-2)-n+4)*n*n/2;}
```
[Try it online!](https://tio.run/##jc/LCoMwEIXhdX2KIaWQ2NqLN6iWPokbm6QxEEfRpBTEZ7cB6d7l8A8fHB4pzpe9Rm6ckPAYrdDduXkuiiKbBmndgBRDDClGMYvwmDJ/4CUu50WjhbbWSD@dFgymYNc7O1Jytw0kkeqwNoCufcmBsHKNAJTIby@5lQKggDRb0@CtNyW8NtyZ2scCDqLCCskJFE2Yf/rrt9zz6TY@zvItfrr661q4lsG8/AA "C (gcc) – Try It Online")
Factored version of the second formula, uses a single function.
Entry point is function `g(n)`, value is returned as integer.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 25 bytes
```
->n{(4-n+(n-2)*n*=n)*n/2}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6vWsNEN09bI0/XSFMrT8s2D0jqG9X@1zDQ0zM00NTLTSyorqmoKVBIi66Irf0PAA "Ruby – Try It Online")
[Answer]
# [Pyt](https://github.com/mudkip201/pyt), 4 bytes
```
Đ²⇹ᑭ
```
[Try it online!](https://tio.run/##K6gs@f//yIRDmx6173w4ce3//9GGOkY6xjomOqaxAA "Pyt – Try It Online")
### Explanation:
```
        Implicit input
Đ       Duplicate
 ²      Square
  ⇹     Swap top two elements on the stack
   ᑭ    Get the (n^2)th n-gonal number
        Implicit output
```
]