[Question]
  [
# Introduction
You're a criminal tasked with stealing some secret plans from the new tech startup Dejavu. You sneak in over the back wall, but find a door that requires a pin to open it. You recognize the make of the lock and know that it takes a 5 digit pin using all numbers from 0 to 4. After each digit entered, the lock checks the last 5 digits entered and opens if the code is correct. You have to get past this lock, and fast. 
# Superpermutations in a Nutshell
A permutation is all possible combinations of a certain set of digits. for example, all the permutations of the digits 0, 1, 2 are:
012, 021, 102, 120, 201, and 210. 
If we concatenate all these permutations together, we get a superpermutation:
012021102120201210
this superpermutation contains all the permutations of 0, 1, 2, but it's possible to make one shorter than this. I'm going to skip a bit here, but the shortest superpermutation of these digits is:
012010210
For our intents and purposes, this is essentially the shortest string of digits that contains all possible permutations of those digits, i.e. a superpermutation.
# Task
Your task is a bit harder than the superpermutation example as shown above, because you have two more digits to worry about. - If you haven't read about superpermutations, or my example above was a bit unclear, I highly suggest you read this great article by Patrick Honner on the subject (this challenge was quite heavily inspired by his article, so kudos to him): <https://www.quantamagazine.org/unscrambling-the-hidden-secrets-of-superpermutations-20190116/>. Your goal is to write the shortest program possible that generates a superpermutation of the digits 0 to 4.
# Scoring
Your program does not take any input of any sort, and produce a superpermutation of the digits from 0 to 4. This resulting superpermutation must be printed to the console or visibly displayed to the user to the extent provided by your language of choice. This doesn't have to be the shortest permutation possible, it just has to be a valid superpermutation. Because of this, the goal is to write the shortest program with the shortest superpermutation, so you should calculate your score like so:
**file size (bytes) \* generated superpermutation length (digits)**
for example, if I had a 40 byte program, and my superpermutation is 153 digits long, my score will be:
**40 \* 153 = 6120**
as always, the goal is to get this score as low as possible. 
# Template
Here is how you should post your answer:
> 
> ## Language | Score
> 
> 
> link to code in working environment (if possible)
> 
> 
> `code snippet` 
> 
> 
> code explanation, etc. 
> 
> 
> 
# Finalities
This is one of my first questions on this site. So please tell me if I'm missing anything or a section of my challenge is unclear. Thank you, and have fun golfing!
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), score = 1673 (7 bytes · 239)
```
žBœ∊{3ý
```
[Try it online!](https://tio.run/##yy9OTMpM/f//6D6no5MfdXRVGx/e@/8/AA "05AB1E – Try It Online")
### How it works
```
žB          push 1024
  œ         permutations: ["1024", "1042", …, "4201"]
   ∊        vertically mirror: ["1024", "1042", …, "4201", "4201", …, "1042", "1024"]
    {       sort: ["0124", "0124", "0142", "0142", …, "4210", "4210"]
     3      push 3
      ý     join: "01243012430142301423…3421034210"
```
# [Pyth](https://github.com/isaacg1/pyth), score = 1944 (9 bytes · 216)
```
s+R+4d.p4
```
[Try it online!](https://tio.run/##K6gsyfj/v1g7SNskRa/A5P9/AA "Pyth – Try It Online")
### How it works
```
 +R   .p4   append to each permutation d of [0, 1, 2, 3]:
   +4d        [4] + d
s           concatenate
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), score = 2907 (19 bytes × 153)
```
4⟦pᶠP∧~l.g;Pz{sᵈ}ᵐ∧
```
Too slow to see anything, but if you change `4` by `2` you can test it: [Try it online!](https://tio.run/##SypKTM6ozMlPN/r/3@jR/GUFD7ctCHjUsbwuRy/dOqCquvjh1o7ah1snAIX@//8fBQA "Brachylog – Try It Online")
This finds the shortest superpermutation as such:
```
4⟦                   The range [0,1,2,3,4]
  pᶠP                P is the list of all permutations of this range
     ∧
      ~l.            Try increasing lengths for the output
         g;Pz        Zip the output with P
             {sᵈ}ᵐ   For each permutation, it must be a substring of the output
                  ∧
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3000 (600\*5 bytes)
```
5ḶŒ!F
```
[Try it online!](https://tio.run/##y0rNyan8/9/04Y5tRycpuv3/DwA "Jelly – Try It Online")
[Answer]
# JavaScript (ES6), 26975 (325 \* 83 bytes)
With this scoring system, there's little room for something between *'hardcode the optimal supermutation'* and *'just use a short built-in to concatenate all permutations'*, at least in non-esolangs.
Here's an attempt anyway.
```
f=(a=[0,1,2,3,4],p=r='')=>a.map((v,i)=>f(a.filter(_=>i--),p+v))|~r.search(p)?r:r+=p
```
[Try it online!](https://tio.run/##XcpLCsIwEADQvafILjN0GvythKlX6F5EYk3alNiEJBQE8erRtcsHb9arzkNysbRLeJhaLYPmy5Z2tKcDHa8UObGUyJ1WTx0BVnI/WNDKOl9Mght3rm2RYrMivj9JZaPTMEHEczqlhmPtBQsLuBnCkoM3yocReuXNMpZJNEKK@6uYLP8C1i8 "JavaScript (Node.js) – Try It Online")
It generates a string of 325 bytes:
```
012340124301324013420142301432021340214302314023410241302431031240314203214032410341203421
041230413204213042310431204321102341024310324103421042310432201342014320314203412041320431
210342104330124301423021430241304123042131024310423201432041321044012340132402134023140312
4032141023410324201342031421034301243021431024320143210
```
[Answer]
# [Python 2](https://docs.python.org/2/), Score: ~~24327~~ ~~15147~~ ~~12852~~ 12628 (154\*82 bytes)
```
S=str(int('OH97GKT83A0GJRVO309F4SGSRWD0S2T292S1JBPVKJ6CRUY8O',36))
print S+S[::-1]
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P9i2uKRIIzOvREPd38PS3N07xMLY0cDdKyjM39jA0s0k2D04KNzFINgoxMjSKNjQyykgzNvLzDkoNNLCX13H2ExTk6ugCKhdIVg7ONrKStcw9v9/AA "Python 2 – Try It Online")
---
Also:
# [Python 2](https://docs.python.org/2/), 12628 (154\*82 bytes)
```
S=oct(int('FS02C3XQJX14OTVMGM70CGCPWU41MNJZ0CO37ZMU0A0Y',36))[:-1]
print S+S[::-1]
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P9g2P7lEIzOvREPdLdjAyNk4ItArwtDEPyTM193X3MDZ3TkgPNTE0NfPK8rA2d/YPMo31MDRIFJdx9hMUzPaStcwlqugCKhdIVg7ONoKxP//HwA "Python 2 – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), score: ~~5355~~ 2160 (216 \* 10 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage))
```
3ÝœJε4yJ}J
```
Port of [*@AndersKaseorg*'s Pyth answer](https://codegolf.stackexchange.com/a/179614/52210), so make sure to upvote him!
[Try it online.](https://tio.run/##yy9OTMpM/f/f@PDco5O9zm01qfSq9fr/HwA)
**Explanation:**
```
3Ý           # Push a list in the range [0,3]: [0,1,2,3]
  œ          # Get all possible permutations of this list
   J         # Join each inner list together to a single string
    ε        # Map each string `y` to:
             #  (Push string `y` implicitly)
     4       #  Push 4
      y      #  Push string `y` again
       J     #  Join all three together
        }J   # After the map: Join all strings together to a single string
             # (and output it implicitly as result)
```
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 27 x 442 = 11934
```
'01234'(perms(1:5)'(4:445))
```
[Try it online!](https://tio.run/##y08uSSxL/f9f3cDQyNhEXaMgtSi3WMPQylRTXcPEysTEVFPz/38A "Octave – Try It Online")
So, it turns out, naively generating *all* the permutations and then truncating to the shortest substring that is still a valid superpermutation is shorter than generating the shortest superpermutation. Sadly, this time the score is not a palindrome.
### [Octave](https://www.gnu.org/software/octave/), 97 x 153 = 14841
```
a=sym(9);while i<120
i=0;a+=1;q='01234';for t=q(perms(1:5))'
i+=any(regexp(char(a),t'));end
end
a
```
[Try it online!](https://tio.run/##NZDBboMwEETvfMVeIkCJIhvSQ0r5gN77AWxgUywROwGTNF9PZ2kj4Scxy8wsDm3kuywb@qROzs4LsaeGG@plFGqHMAnFQLEXmuarjHguc@Togt/pgIchPP7GYZhVTjaqI8pNPZ3kHJCj8144ooNjT@G8KrN3dxkn2dNXoAs7H3HWSRvGUdpIyDo9o77PPu6wI3eddMTUnOrpecmOeUP/llc9KrHRPkl4/SK1RXkwCmsUhVGURmEPRgEJKI3CGkVxMApIAHxAYRQWWYrCKKxRIAuARQEJKI0CFgAlCkgAfIDVLJvm1fL6i@rRu0HIfaAncbWpeFvb6lan6@ZphUukWN8yvf0ps@9veZ4mbluzf2ajfMvPNWt7HjPOdzHN80p8l@jhZfkF "Octave – Try It Online")
Entry updated for a few things
* `a++` is not implemented for symbolic numbers.
* `contains()` is not implemented in Octave. Replaced with `any(regexp())`.
* In the online link, I manually entered an `a` very close to the 153-length superpermutation. This allows for the solution to be verified.
[Answer]
## CJam (6 \* 240 = 1440)
```
5e!72>
```
[Online demo](http://cjam.aditsu.net/#code=5e!72%3E), [validation](http://cjam.aditsu.net/#code=5e!72%3E%0A%0Ae_5e!%5Cf%7B%5C%23%7Dp) (outputs the index at which each permutation of `0..4` can be found; it needs to flatten the output because the original program gives suitable output to stdout but what it places on the stack is not directly usable).
Approach [stolen from Sanchises](https://codegolf.stackexchange.com/a/179644/194), although the permutation order of CJam is different, giving a different substring.
---
## CJam (22 \* 207 = 4554)
```
0a4{)W@+W+1$)ew\a*W-}/
```
[Online demo](http://cjam.aditsu.net/#code=0a4%7B)W%40%2BW%2B1%24)ew%5Ca*W-%7D%2F), [validation](http://cjam.aditsu.net/#code=0a4%7B)W%40%2BW%2B1%24)ew%5Ca*W-%7D%2F%0A%0A5e!%5Cf%7B%5C%23%7Dp).
### Dissection
This uses a simple recursive construction.
```
0a       e# Start with a superpermutation of one element, [0]
4{       e# for x = 0 to 3:
  )      e#   increment it: n = x+1
  W@+W+  e#   wrap the smaller superpermutation in [-1 ... -1]
  1$)ew  e#   split into chunks of length n+1
  \a*    e#   insert an n between each chunk
  W-     e#   remove the -1s from the ends
}/
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 29 bytes, output length 153, score 4437
```
”)⊞⧴�r3⁼Ｈ⁴↓¦σ✳ＬïpＷＳ [Ｔ↑ZωÞ”‖Ｏ
```
[Try it online!](https://tio.run/##FcsxCoAwEETR3mNYaSFskulyCMUbhBBRCCoheP11p3nFh5/P1PKTqurWrrtPozgfQATEgXgQCSCWDA8iIC6AWDLsMxzIOMdhL0ctua9faTW90xxVdfnqDw "Charcoal – Try It Online") Link is to verbose version of code. Explanation: Like @TFeld, I just print half of a superpermutation and mirror it. I calculated the superpermutation using the following code:
```
Push(u, w);
for (u) {
    Assign(Plus(Plus(i, Length(i)), i), h);
    Assign(Ternary(i, Join(Split(w, i), h), h), w);
    Assign(Incremented(Length(i)), z);
    if (Less(z, 5)) for (z) Push(u, Slice(h, k, Plus(k, z));
}
Print(w);
```
This translates to a 45-byte program in Charcoal so would have scored 6885.
[Answer]
# [MATL](https://github.com/lmendo/MATL), 16 x 442 = 7072
```
4Y25:Y@!)K442&:)
```
[Try it online!](https://tio.run/##y00syfn/3yTSyNQq0kFR09vExEjNSvP/fwA "MATL – Try It Online")
MATL port of my Octave answer. -442 thanks to Luis Mendo
[Answer]
# Japt -P, 2376 (11 x 216)
```
4o ¬á Ë+4+D
```
[Try it!](https://ethproductions.github.io/japt/?v=1.4.6&code=NG8grOEgyys0K0Q=&input=LVA=)
-1 byte thanks to @ Shaggy!
Port of Anders Kaseorg's [Pyth answer](https://codegolf.stackexchange.com/a/179614/8340).
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 7191 (153\*47 bytes)
```
say first *.comb(permutations(5).all.join),0..*
```
[Try it online!](https://tio.run/##K0gtyjH7/784sVIhLbOouERBSy85PzdJoyC1KLe0JLEkMz@vWMNUUy8xJ0cvKz8zT1PHQE9P6/9/AA "Perl 6 – Try It Online")
Finds the first number that contains all permutations of the digits 0 to 4. This will take a *long* time to execute, but you can test it with the first two permutations [`0`](https://tio.run/##K0gtyjH7/784sVIhLbOouERBSy85PzdJoyC1KLe0JLEkMz@vWMNQUy8xJ0cvKz8zT1PHQE9P6/9/AA) and [`0,1`](https://tio.run/##K0gtyjH7/784sVIhLbOouERBSy85PzdJoyC1KLe0JLEkMz@vWMNIUy8xJ0cvKz8zT1PHQE9P6/9/AA)
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 153\*95 bytes, 14535
```
Nest[Flatten[Join[#,{Max@#+1},#]&/@Partition[#,Max@#+1,1]]//.{b__,a__,a__,c__}:>{b,a,c}&,{0},4]
```
[Try it online!](https://tio.run/##NcmxCsIwEIDh3aeQBrp4GAtOgpLJQap0DyFcQ0gDNoX2BiHk2U@EOPzwwT8jTX5Gig45XPnlN9L3NxL5pB9LTFpAfuJHiUNXQJhWqgFXihSX36oHOmOkPObRWsCas7ZcbnkEBFdayKcCZ8PDGhPtVdhVNM1fvU@BJhWYvw "Wolfram Language (Mathematica) – Try It Online")
]