[Question]
  [
# Main task
Your task is to print out integers in descending order, starting from 1, and increasing as you keep hitting 1 again, up until the given input is reached, then, print out the rest until you hit 1 again. Example with input `6`:
```
1
21
321
4321
54321
654321
Without newlines (valid output):
121321432154321654321
```
*Side note: this is [A004736](https://oeis.org/A004736) in the OEIS. Also, the first example (with newlines) is an invalid output, as specified in the rules.*
# Input
Your code may take any kind of input (graphical, STDIN) in the form of an integer or number.
# Output
Your code should output the above described sequence, up until the input number is reached, then finish to output until it reaches 1 again. The output may be anything, therefore numbers, strings, integers, or graphical output. It is required to print out a single number (no newlines if it's a string). Your output can be in- and outroduced with as many characters as you need (e.g. `[]`).
Since there was some misunderstanding, here's a regex pattern you can try your outputs on.
```
^(\D*(\d)+\D*)$
```
# Rules
* The output must be a full number, not split up by anything, not even newlines.
* The algorithm shouldn't check for the first instance of N appearing in any way (e.g. the `21` in `121321`), but rather for the first instance of N as the actual number.
* A single trailing newline is allowed.
* The handling for negative input is fully your choice, negative numbers aren't cases you should test.
## Test cases
```
Input: 6
Output: 121321432154321654321
```
Input: 1
Output: 1
Input: 26
Output: 121321432154321654321765432187654321987654321109876543211110987654321121110987654321131211109876543211413121110987654321151413121110987654321161514131211109876543211716151413121110987654321181716151413121110987654321191817161514131211109876543212019181716151413121110987654321212019181716151413121110987654321222120191817161514131211109876543212322212019181716151413121110987654321242322212019181716151413121110987654321252423222120191817161514131211109876543212625242322212019181716151413121110987654321
Input: 0
Output: 0, Empty, or Error
Input: 21
Output: 121321432154321654321765432187654321987654321109876543211110987654321121110987654321131211109876543211413121110987654321151413121110987654321161514131211109876543211716151413121110987654321181716151413121110987654321191817161514131211109876543212019181716151413121110987654321212019181716151413121110987654321
Thanks @Emigna, I used his algorithm to calculate these test cases.
## Winner
The winner has been chosen! It was [ErikGolfer's answer](https://codegolf.stackexchange.com/a/103682/62824) with an impressive **5** bytes! Congratulations!
  
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), 6 bytes
```
L€LíJJ
```
[Try it online!](http://05ab1e.tryitonline.net/#code=TOKCrEzDrUpK&input=Ng)
**Explanation**
Example input 4
```
L       # range [1 ... input]
        # STACK: [1,2,3,4]
 €L     # map: range
        # STACK: [[1],[1,2],[1,2,3],[1,2,3,4]]
   í    # reverse each
        # STACK: [[1],[2,1],[3,2,1],[4,3,2,1]]
    J   # join inner lists
        # STACK: ['1','21','321','4321']
     J  # join list
        # OUTPUT: 1213214321
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
RRUVV
```
[Try it online!](https://tio.run/nexus/jelly#@x8UFBoW9v//fyMzAA "Jelly – TIO Nexus")
[Formula not mine.](/a/103673/41024)
I suspect there is too much going on here...
[ANSWER ACCEPTED] I'd have given some 5 rep to Dennis, but this is not Reputation Exchange. Dennis showed me the `VV` behavior. To my surprise, this is shorter than 05AB1E.
[Answer]
## JavaScript (ES6), 37 bytes
```
f=(n,k=1)=>k>n?n--?f(n):'':f(n,k+1)+k
```
### Demo
```
f=(n,k=1)=>k>n?n--?f(n):'':f(n,k+1)+k
console.log(f(6))
```
### Alternate method for n < 10, 34 bytes (non-competing)
```
f=(n,s='1')=>--n?s+f(n,++s[0]+s):s
```
In JavaScript, strings are immutable. Therefore, it's impossible to alter the content of the Nth character of a string `s` by assigning a new value to `s[N]`.
However, the expression `++s[N]` is valid and does evaluate as one would expect, even if the string remains unchanged. For instance:
```
++"1"[0] // equals 2
```
And by extension:
```
s = "21"
++s[0] + s // equals "321"
```
[Answer]
# V, ~~29~~ ~~28~~ ~~27~~ ~~23~~ ~~19~~ ~~17~~ 16 bytes
***8*** bytes saved thanks to @DJMcMayhem
***3*** bytes saved thanks to @nmjcman101
```
"apÀ­ñÄòy$jpkgJ
```
Hidden characters:
```
"apÀ<C-x>ñÄ<C-x>òy$jpkgJ
```
`C-x` is Ctrl+x.
[Try it online!](https://tio.run/nexus/v#@6@UWHC44dDawxsPt0gc3lSpklWQne71//9/MwA "V – TIO Nexus") takes input via command-line arguments
Hexdump:
```
0000000: 2261 70c0 adf1 c418 f279 246a 706b 674a  "ap......y$jpkgJ
```
### Explanation
```
"ap            Paste the argument
À<C-x>         Argument minus 1 times (so that we exclude the 0)
ñ ... ò        Loop (for some weird reason the ò closes the ñ)
Ä<C-x>         paste current line above and decrement it
```
Now it looks like:
```
1
2
...
n
```
*continued...*
```
ò             recursively do (until a breaking error)
y$             yank this line
  jp           paste it down
    kgJ        go up and join
              implicit ò end
```
### GIF (outdated)
(for arg `6`)
[![gif](https://i.stack.imgur.com/70Mlu.gif)](https://i.stack.imgur.com/70Mlu.gif)
[Answer]
# C#, ~~72~~ ~~69~~ 65 bytes
```
n=>{for(int i=0,j;i<n;)for(j=++i;j>0;)System.Console.Write(j--);}
```
If the output can just be returned as opposed to being Written to the console
# C#, ~~71~~ ~~68~~ 64 bytes
```
n=>{var s="";for(int i=0,j;i<n;)for(j=++i;j>0;)s+=j--;return s;}
```
Thanks to @VisualMelon for saving a lot of bytes
Test it [here](http://rextester.com/SSRRG76375) (Humourously the online compiler breaks at any number above 420)
[Answer]
# Pure bash, 34
```
eval eval printf %s \\{{1..$1}..1}
```
Two levels of brace expansion. With input `6`, the first level expands to `{1..1} {2..1} {3..1} {4..1} {5..1} {6..1}`. This then expands to `1 2 1 3 2 1 4 3 2 1 5 4 3 2 1 6 5 4 3 2 1`, which is smushed together to one string with `printf %s`. `eval`'s are required at both levels of expansion - for the first level so that the `$1` parameter is expanded first, and for the second level so that it expands after the first level.
[Try it online](https://tio.run/nexus/bash#@59alpijACYKijLzStIUVIsVYmKqqw319FQMa/X0DGv///9vBgA)
[Answer]
## Perl, 21 bytes
**Uses `-E` at no extra cost.**
```
say map$}=$_.$},1..<>
```
### Usage
```
perl -E 'say map$}=$_.$},1..<>' <<< 6
121321432154321654321
```
[Answer]
# Pyth, 7 bytes
```
jks}R1S
```
A program that takes input of an integer and prints the result.
[Try it Online!](http://pyth.tryitonline.net/#code=amtzfVIxUw&input=Ng)
**How it works**
```
jks}R1S   Program. Input: Q
jks}R1SQ  Implicit input fill
    R     Map
      SQ  over [1, 2, 3, 4, ..., Q] with i:
   } 1     Yield [i, i-1, i-2, i-3, ..., 1]
  s       Merge
jk        Join
          Implicitly print
```
[Answer]
# [GeoGebra](https://www.geogebra.org/), 67 bytes
```
1
InputBox[a]
Sum[Join[Sequence[Sequence[Text[j],j,i,1,-1],i,1,a]]]
```
Each line is entered separately into the input bar. Input is taken from an input box.
Here is a gif of the execution:
[![Program execution](https://i.stack.imgur.com/SMsZB.gif)](https://i.stack.imgur.com/SMsZB.gif)
**How it works**
Entering `1` implicitly assigns `a` to `1`, and the `InputBox` command associates an input box with `a`. Then, for each `i` in `{1, 2, 3, ..., a}`, the list `{i, i-1, i-2, ..., 1}` is created using the `Sequence` command, and each `j` in that list is converted to a string using `Text`. Finally, `Join` merges all the lists, and `Sum` concatenates all the elements to one text object, which is displayed.
[Answer]
## Python 2, 51 bytes
```
r=s=''
n=0
exec'n+=1;s=`n`+s;r+=s;'*input()
print r
```
[Answer]
## [Retina](https://github.com/m-ender/retina), ~~26~~ 22 bytes
Byte count assumes ISO 8859-1 encoding.
```
.+
$*
$`¶
1
$.%'
0?¶
```
[Try it online!](https://tio.run/nexus/retina#@6@nzaWixcWlknBoG5chl4qeqjqXgT2Q/f@/oQEA "Retina – TIO Nexus")
### Explanation
```
.+
$*
```
Convert input to unary.
```
$`¶
```
At each position, insert the prefix up to that point, as well as a linefeed. This creates a unary range from `2` to `n+1`, one value per line.
```
1
$.%'
```
Replace each `1` with the number of characters after it on the same line. This turns something like `11111` into `43210`.
```
0?¶
```
Remove all linefeeds and the zeros preceding them.
[Answer]
# GameMaker Language, 65 bytes
```
b=""for(i=1;i<=argument0;i++){c=i while(j)b+=string(c--)}return b
```
[Answer]
# APL, 10 bytes
```
∊⍕¨∘⌽∘⍳¨∘⍳
```
E.g.:
```
      (∊⍕¨∘⌽∘⍳¨∘⍳)6
121321432154321654321
```
Explanation:
* `⍳`: get the numbers from 1 to N.
* `⍳¨∘`: for each of those, get the numbers from 1 to N.
* `⌽∘`: reverse that list
* `⍕¨∘`: get the character representation of each item (so it does not output the numbers with spaces in between)
* `∊`: flatten the resulting array
[Answer]
# Python 2, ~~71~~ 68 bytes
I bet a recursive solution could be shorter, but I'm having a hard time formulating this into one.
```
n=input()
i=0
o=""
while i<n:
    i+=1;j=i
    while j:o+=`j`;j-=1
print o
```
[**Try it online**](https://tio.run/nexus/python2#@59nm5lXUFqiocmVaWvAlW@rpMRVnpGZk6qQaZNnxcWZqW1raJ1lm8nFCRHNssrXtk3ISrDO0rU15CooyswrUcj//98MAA)
[Answer]
# Actually 8 bytes
```
RR♂RΣRεj
```
First time posting an answer in Actually so it probably can be golfed.
**How it works**
```
Program takes implicit input, implicit print at EOF
R           Takes the input and creates a range (1, input)   
                STACK = [1,2,..,n]
 R          Reverse the top stack item (our range)
                STACK = [n,..,2,1]
  ♂R        For each item in our range, create a range (1, rangeitem)
                STACK = [[1,2,..,n], .., [1,2], [1]]
    Σ       Stitch the items of the list together
                STACK = [n,..,1,2,3,1,2,1]
     R      Reverse the top stack item again (our answer)
                STACK = [1,2,1,3,2,1,..n]
      εj    Create an empty string and append each item from the list to it.
            (turns non string items into strings)
```
[Try it online!](https://tio.run/nexus/actually#@x8U9GhmU9C5xUHntmb9/28GAA)
[Answer]
# [Perl 6](https://perl6.org/), 22 bytes
```
{[~] flat [\R,] 1..$_}
```
A lambda that returns a string.
([Try it online.](https://tio.run/#RlzAo))
### Explanation:
* `1..$_`: Range of integers... `(1 2 3 4)`
* `[,] 1..$_`: Reduce ("fold") over comma operator... `(1 2 3 4)`
* `[\,] 1..$_`: With intermediate results ([triangular reduce](http://perl6maven.com/tutorial/perl6-reduction-triangle))... `((1) (1 2) (1 2 3) (1 2 3 4))`
* `[\R,] 1..$_`: Apply [reversing](https://docs.perl6.org/language/operators#Reversed_Operators) meta-operator to the comma... `((1) (2 1) (3 2 1) (4 3 2 1))`
* `[~] flat ...`: Remove list nesting, and fold over string concat operator... `1213214321`
[Answer]
## Haskell, 35 bytes
```
f x=[1..x]>>= \y->[y,y-1..1]>>=show
```
Usage example: `f 6` -> `"121321432154321654321"`.
For all numbers `x` in `1 ... x` make a list `x,x-1, ... ,1`, turn the numbers into a string and concatenate them into a single string. Again, concatenate those strings into a single string. 
[Answer]
# C89, 54 bytes
```
i,j;f(n){for(i=1;j<=n;j=i++)while(j)printf("%d",j--);}
```
56 -2 = 54 thanks to ErikGolfer!
[Answer]
# Python 3, 87 92 83 74 bytes
```
lambda n:"".join(["".join([str(i)for i in range(1,k)][::-1])for k in range(1,n+2)])
```
Shorter answer using recursion :
```
f=lambda n:f(n-1)+"".join([str(i)for i in range(1,n+1)][::-1])if n>0else""
```
Maybe not the shortest one but it's only made with Python's list comprehension !
*(Edited to add the print function and remove the \n)*
*(Edited to remove the print function, and change n+1, k+1 to n,k+2)*
[Answer]
# [Brachylog v1](http://github.com/JCumin/Brachylog), 8 bytes
```
yb@[rcw\
```
[Try it online!](http://brachylog.tryitonline.net/#code=eWJAW3Jjd1w&input=Ng)
### Explanation
```
yb         The list [1, ..., Input]
  @[       Take a prefix of that list
    rc     Reverse it and concatenate into an integer
      w    Write to STDOUT
       \   Backtrack: try another prefix
```
[Answer]
# Pyth, 8 bytes
```
jks_M._S
```
### Explanation
```
jks_M._SQ   Implicit input
       SQ   Get the range [1, 2, ..., N]
     ._     Get each prefix
   _M       Reverse each prefix
jks         Join everything as a string
```
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), 6 bytes
```
LR.sJJ
```
[Try it online!](http://05ab1e.tryitonline.net/#code=TFIuc0pK&input=Ng)
[Answer]
## Mathematica, 36 bytes
```
ToString/@(""<>Range[Range@#,1,-1])&
```
Throws a bunch of warnings which can be safely ignored.
### Explanation
Using input `5` as an example:
```
Range@#
```
Creates a range `{1, 2, 3, 4, 5}`.
```
Range[...,1,-1]
```
`Range` is listable so we can give it a list for any of its arguments and it will automatically thread over that argument. So this gives us a bunch of reversed lists:
```
{{1}, {2, 1}, {3, 2, 1}, {4, 3, 2, 1}, {5, 4, 3, 2, 1}}
```
Next:
```
(""<>...)
```
This joins the nested list with the empty string. Since the nested list doesn't actually contain any strings, it can't really join the values (which is where the warnings are generated), but `""<>` has the side-effect of flattening the list. So this gives us
```
1 <> 2 <> 1 <> 3 <> 2 <> 1 <> 4 <> 3 <> 2 <> 1 <> 5 <> 4 <> 3 <> 2 <> 1
```
Now comes Mathematica's beautiful feature that `Map` doesn't care about the structure it's mapping over. You normally apply it to a list, but it works with any head. `f /@ h[a, b, c]` simply gives you `h[f[a], f[b], f[c]]`. In our case, the head is `StringJoin` and the values are the integers.
```
ToString/@...
```
So this simply turns the integers into strings. At that point `StringJoin[...]` knows what to do with them and joins them all into a single string:
```
"121321432154321"
```
[Answer]
# [GolfScript](http://www.golfscript.com/golfscript/), 14 bytes
```
~,{),{)}%-1%}%
```
[Try it online!](https://tio.run/nexus/golfscript#@1@nU60JRLWquoaqtar//5sBAA "GolfScript – TIO Nexus")
Usual method of course, but this is GolfScript.
Explanation for this **VAST** piece of code:
```
~,{),{)}%-1%}% # Code
               # Initial stack.      ["n"]
~              # Eval ToS.           [n]
 ,             # ToS' lowered range. [[0..n)]
  {),{)}%-1%}  # Block. 1 argument.  [a]
   )           # Increment.          [a+1]
    ,          # Range.              [[0..a)]
     {)}       # Block. 1 argument.  [b]
      )        # Increment.          [b+1]
        %      # Map.                [[1..a]]
         -1    # Integer. -1         [[1..a] -1]
           %   # Each nth element.   [[a..1]]
             % # Map.                [[[1],[2,1],...,[n..1]]]
               # Implicit output.    121...n..1
```
Note that output is as a single number. Trailing `\n`.
[Answer]
# R, ~~38~~ ~~33~~ 44 bytes
```
if((n=scan())>0)for(i in 1:n)cat(i:1,sep="")
```
Takes input to STDIN, and loops from 1 to n, creating the sequence i to 1 for each step and printing it.
Edit: replaced `seq(i,1)` by `i:1` saving 5 bytes and showing why I shouldn't golf during meetings.
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~14~~ 11 bytes
```
:"@:P]v!VXz
```
[Try it online!](https://tio.run/nexus/matl#@2@l5GAVEFumGBZR9f@/kSEA "MATL – TIO Nexus")
### Explanation
```
:      % Input N implicitly. Push range [1 2 ...N]
"      % For each k in [1 2 ...N]
  @:   %   Push range [1 2 ... k]
  P    %   Reverse
]      % End
v!     % Concatenate all arrays horizontally
V      % Convert to string
Xz     % Remove spaces. Display implicitly
```
[Answer]
# brainfuck, 17 bytes
```
>,[>[+.>]+.[<]>-]
```
## Explanation
```
>           keep the first cell at 0
 ,          input of the decimal number into the cell
  [>        start a conditionnal loop and go to the next cell
   [+.>]    while it don't find 0, increment each cells and output the value
    +.      increment the new cell and output
     [<]    go to the first cell
      >-]   decrement the second cell and restart
```
[Try it online!](http://brainfuck.tryitonline.net/#code=PixbPlsrLj5dKy5bPF0-LV0&input=Bg&debug=on)
[Answer]
# [Python](https://docs.python.org), ~~63~~ ~~57~~ 59 bytes
A recursive solution that works in both Python 2 and 3. This can probably be golfed further. Golfing suggestions welcome! [Try it online!](https://tio.run/nexus/python3#FckxDoAgEATA3lcQqiOi0cbCxMecQQxGFnLi@xGbaab67ea4O1ZYoRhOecIwm17r8UoBFDnTU8QK4zwIdrJtjUmidZcloJCn34D8Fmpjal0@ "Python 3 – TIO Nexus")
**Edit:** -6 bytes thanks to Jonathan Allan. +2 bytes with thanks to mbomb007 for pointing out a problem with my answer.
```
f=lambda n:n and f(n-1)+"".join(map(str,range(n,0,-1)))or""
```
**Ungolfing**
```
def f(n):
    s = ""
    for i in range(n+1):
        m = map(str, range(n, 0, -1))
        s += "".join(m)
    return s
```
[Answer]
# CJam, 13 bytes
```
ri,:){,:)W%}%
```
[interpreter](//cjam.aditsu.net#code=ri%2C%3A)%7B%2C%3A)W%25%7D%25&input=6)
[Answer]
# PHP, ~~35~~ ~~34~~ 33 bytes
*Saved a byte because I miscounted, thanks Titus! And another!*
```
while($i++<$argv[1])echo$s=$i.$s;
```
Run from command line with `-r`.
Pretty simple answer, loops from 1 through our input `n`, tacking the number onto the beginning of the string and printing it out.
]