text:
Output integers in negative order, increase the maximum integer everytime
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 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 with an impressive 5 bytes! Congratulations!

The output must be a full number ... Do you mean the entire sequence, or only the different substrings (1, 2-1, 3-1 ...)? Your first example doesn't seem to match this statement.

If the output has to be a single number, how can it be "arrays"?

Would this array be acceptable as output? [1, 21, 321, 4321, 54321, 654321]
How about this one? [1,2,1,3,2,1,4,3,2,1,5,4,3,2,1,6,5,4,3,2,1]
Or are you just talking about arrays with a single element, like [121321432154321654321] ?

Can we assume that input is always positive?

Ah, so it's okay to write a lambda that outputs an array, only if the array's default stringification as used by the language's standard IO routines would turn it into that single number without anything to separate the digits?

I'm confused about the output format. Can you give examples of what is acceptable? Array of numbers? String with numbers separated by spaces?

I'm going to delete my comments to clean this up. All of your questions should've been answered in the question after editing.

Your regex allow output of mickey321211mouse. Really the \D parts have no reason to be there

@edc65 It actually allows for an empty output too. The regex is ^(\D*(\d)*\D*|)$, and if you note the last pipe|, you will realize that empty output would have been allowed too.

Still allowing mickey123mouse after the edit. But now  at least a digit is required

@edc65 It is on purpose, so outputs like [123] or 123\n are accepted.

Does this answer your question? Create an array with repeated numbers

Jelly, 5 bytes
RRUVV

Try it online!
Formula not mine.
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.

05AB1E, 6 bytes
L€LíJJ

Try it online!
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

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"

Does not seem to work for n > 9

@edc65 You're right, of course. I don't know why I thought it was OK to stop at 9.

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! 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)

I got a few by changing your loop to a) end implicitly and b) join the lines as it goes (rather than at the end) òy$jpkgJ

@nmjcman101 Thanks for helping me save 2 bytes!

This is pretty well golfed. I've been racking my brains for a good 20 minutes, and I can't think of anything shorter. :)

@DJMcMayhem It's because I've had some great help :)

I did it! You can get down to 16 bytes.  If you paste the arg, and then duplicate/decrement upwards, you get to remove the H.  Then if you use the decrement operator on your À, you won't have the 0 at the top so you can remove the x.  Then APPARENTLY a ò will close a ñ so you can remove the second ñ (which is the byte you save).  Link because that made no sense

@nmjcman101 I never knew the argument would be stored in the "a register. Thanks again!

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 (Humourously the online compiler breaks at any number above 420)

That was really fast.

@devRicher What can I say, I was waiting for something to be posted :P

There is never a reason to use a while loop in C# code golf, a for-loop will always perform as well if not better. In this case, you can include the assignment of j=1 in the for-loop, and save a semi-colon. You can also declare j along with i, to save the int. The i++ can also be moved to the j=i assignment, saving a byte. You should also be able to replace the i<=n with i<n if you make it j=++i instead and start i at 0.

@VisualMelon edited it, saved 3 bytes! Declaring the ints together actually made no difference to the byte count but it makes the loops look a bit nicer

@AlfieGoodacre if you declare them together in the for loop, then you'll save 2 more bytes for(int i=0,j;i<n;) ;) There is also no need for the {} around the inner for loop.

@VisualMelon right you are. There is no {} on the inner loop as it stands anway

@AlfieGoodacre around the for loop (i.e. the block for the outer for-loop; you don't need it because it only contains one statementy thing)

@VisualMelon thanks, I didn't actually know that - I thought the for and its statement would count as two and therefore need braces

Perl, 21 bytes
Uses -E at no extra cost.
say map$}=$_.$},1..<>

Usage
perl -E 'say map$}=$_.$},1..<>' <<< 6
121321432154321654321

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

Pyth, 7 bytes
jks}R1S

A program that takes input of an integer and prints the result.
Try it Online!
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

Personally I'm very disappointed that jk_hC.:S is longer, but nice work!

GeoGebra, 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:

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.

Retina, 26 22 bytes
Byte count assumes ISO 8859-1 encoding.
.+
$*

$`¶
1
$.%'
0?¶

Try it online!
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.

Python 2, 51 bytes
r=s=''
n=0
exec'n+=1;s=`n`+s;r+=s;'*input()
print r

GameMaker Language, 65 bytes
b=""for(i=1;i<=argument0;i++){c=i while(j)b+=string(c--)}return b

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!

I'm not sure that there is a shorter solution, but I've proven myself wrong before. In any case, here's a Try It Online link for your answer.

The code R♂R♂RΣεj is the same number of bytes, but it may be easier to write an explanation for.

@Sherlock9 your way is a little more elegant, I've added the link and an explanation which I forgot to add on yesterday to try explain it a bit more.

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

So it's parsing the code backwards?

∘ is function composition, I gave the explanation in the order that the functions are actually evaluated

Here's the parse tree, for the curious: http://tryapl.org/?a=%u220A%u2355%A8%u2218%u233D%u2218%u2373%A8%u2218%u2373&run

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

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)

Works with k, n+2 but not with k+2, n, thanks though for the idea :)

The code that you're scoring should be first. Also, you should use Python 2 and then use \i`instead ofstr(i). And you can use "".join(...)instead of"".join([...]), and range(1,k,-1)to remove the[...][::-1]`.

Also, n>0 can be n. And I meant range(n,0,-1). And use n and f(n-1)+...)or"".

62 bytes. Actually, this may be getting too close to this answer.

Yes this is getting pretty close, I saw that after doing my second version :(

Brachylog v1, 8 bytes
yb@[rcw\

Try it online!
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

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!

I think you can do (j=i++) instead of (j=i) and remove the last i++ (untested).

Here's a shorter recursive version: i,j;f(n){j=++i;while(j)printf("%d",j--);i-n?f(n):0;} (52 bytes)

@Steadybox You can add that as your own answer if you like, but thanks!

@cat Ok, thanks, just did. Wasn't sure if I should since I only edited your solution.

Perl 6, 22 bytes
{[~] flat [\R,] 1..$_}

A lambda that returns a string.
(Try it online.)
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)... ((1) (1 2) (1 2 3) (1 2 3 4))
[\R,] 1..$_: Apply reversing 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

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.

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!

Welcome to PPCG! Have you read the tour page and the hottest meta questions yet? I advise you to, they're helpful! Also, wrap your code in code formatting! Have you read the formatting help? You should also explain how your code works, if you can!

@muddyfish I've just added the explanation

I've used a mobile app. You can see the screen of the result.

No it's fine. But in the link, the ouput is in ascii and not in decimal, so you don't really see the output

@muddyfish  Your permalink is a tad confusing. There's an invisible 0x06 in the input, followed by the decimal digit 6.

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

05AB1E, 6 bytes
LR.sJJ

Try it online!

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.

This produces 101 if the input is 0. if((n=scan())>0)for(i in 1:n)cat(i:1,sep="") does the trick.

Damn, assumed non-zero input :(

if(n<-scan()) should be sufficient.

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"

That's just plain nasty. :)

GolfScript, 14 bytes
~,{),{)}%-1%}%

Try it online!
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.

MATL, 14 11 bytes
:"@:P]v!VXz

Try it online!
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

not split up by anything, don't think the second one is allowed.

@JarkoDubbeldam I'll delete that one until OP clarifies

@Jarko The OP clarified. Current solution conforms to spec

Python, 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!
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

Use a map to save 6 bytes: lambda n:n and f(n-1)+"".join(map(str,range(n,0,-1)))or""

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.

I count 34. One byte shorter with post-increment.

33 bytes: while($i++<$argv[1])echo$s=$i.$s;

CJam, 13 bytes
ri,:){,:)W%}%

interpreter

You can save 2 bytes: ri{),:)W%}%

@LuisMendo Neat, thanks for that!

Brachylog (v2), 7 bytes
⟦₁⟧₁ᵐcc

Try it online!
Function submission. (The TIO link contains a command-line argument to run a function as though it were a full program.)
This would be just five bytes if the sequences went down to 0 rather than 1 – so it seems that this is one of those questions that's decided by the choice of 0- versus 1-indexing.
Explanation
⟦₁⟧₁ᵐcc
⟦₁       Range from 1 to {the function input}
    ᵐ    On each element of that range,
  ⟧₁       take a descending range from that value to 1
     c   Concatenate the ranges
      c  Concatenate the digits of the resulting numbers

Mathematica, 38 54 bytes
FromDigits@*Flatten@IntegerDigits@Range[Range@#,1,-1]&

I stole Range[Range@#,1,-1] from Martin Ender's (still shorter) answer to save three bytes (dammit, I gotta start remembering that some functions are Listable). IntegerDigits converts the multi-digit numbers in the result to lists of single digits, Flatten removes all the list nesting, and FromDigits reassembles them into an integer. Oh well.

PHP, 52 49 bytes
<?for(;$k++<$argv[1]+2;$j=$k)while(--$j>0)echo$j;

Don't you need to outroduce your code with a > or ?>?

You can remove the braces around the inner {while...}. @devRicher the closing tag is not necessary, and it is generally considered best practice not to include it in code-only scripts.

@primo Thanks for suggestion, but I can't since inner while and $j=$k; are both tied to first while condition. @devRicher no that's not necessary

@Dexa you could change the first while to a for, and move the $j=$k into the post-evaluation: for(;$k++<$argv[1]+2;$j=$k).

@primo Thanks, edited.

C#, 67 65 bytes
f=n=>{int x=n;var r="";while(n>0)r+=n--;return x>0?f(x-1)+r:"";};

Anonymous recursive function which returns the required string.
Full program with ungolfed method and test cases:
using System;

public class Program
{
    public static void Main()
    {
        Func<int, string> f = null;
        f = n =>
        {
            int x = n;
            var r = "";
            while (n > 0)
                r += n--;
            return x > 0 ? f(x - 1) + r : "";
        };

        Console.WriteLine(f(6));    // 121321432154321654321
        Console.WriteLine(f(1));    // 1
        Console.WriteLine(f(26));   // 121321432154321654321765432187654321987654321109876543211110987654321121110987654321131211109876543211413121110987654321151413121110987654321161514131211109876543211716151413121110987654321181716151413121110987654321191817161514131211109876543212019181716151413121110987654321212019181716151413121110987654321222120191817161514131211109876543212322212019181716151413121110987654321242322212019181716151413121110987654321252423222120191817161514131211109876543212625242322212019181716151413121110987654321
        Console.WriteLine(f(0));    // "" (empty string)
    }
}

I'm not sure if I could condone anonymous recursive functions, given that you need to declare and assign it beforehand for it to work (you can't call it directly: see test code). (Note: I'm personally not a fan of anonymous methods as answers, but this I think is step too far)

Looks like there is already a policy on this: http://meta.codegolf.stackexchange.com/questions/10360/how-should-i-submit-an-anonymous-lambda-that-has-a-self-reference

The function name is actually included in the byte count (f=...). Also, the C# example from the accepted answer in the meta.codegolf link you provided will not compile! You need to declare the anonymous function first, like in this answer: http://stackoverflow.com/a/61206/6649825

Indeed. Honestly, I'm not happy with the allowance of code that can't be called directly (e.g. codehere(arguments)) or that doesn't provide a named method to call (actually, I'd prefer that all C# submissions were a complete program). I might bring this up on meta, because it doesn't feel like there is quite a clear consensus on lambdas in general, but it does feel like this is a step too far. If I post something on meta, I'll put a link here, and you can feel free to join in the discussion.

I guess anonymous methods are allowed to further reduce the code size - verbose languages like C# or Java 8+ are more competitive this way (however they are no match for a golfing language). Otherwise, we'd still use classic method definitions.

You're quite right, but I'm miserable and old-fashioned, and like to see code that I can compile and run, not where I have to wrap it in parentheses, and tell the computer what type it expects to make it work. Static Typing is an invaluable feature in C# (and Java, and others) which we shouldn't get it for free. I'm writing up a (probably very long) meta question, we'd probably better defer any further discussion away from this thread. It's an import issue, one I'm sure I'm not going to get my way on (though I think I hold it objectively), but it needs a consensus we can follow nonetheless.

Posted: http://meta.codegolf.stackexchange.com/questions/10974/c-lambdas-as-answers-to-questions-asking-for-a-function - no idea how it will be received, but might elicit some sort of discussion. Please do chime in if you have comments (there are relatively few C#ers here, and it's really meant for us).

Octave, 47 48 bytes
@(n)num2str((g=meshgrid(n:-1:1)')(g<=1:n)','%d')

Try it online!
Explanation:
meshgrid(n:-1:1)' :create a grid of repeated n:1
   6   6   6   6   6   6
   5   5   5   5   5   5
   4   4   4   4   4   4
   3   3   3   3   3   3
   2   2   2   2   2   2
   1   1   1   1   1   1

(g<=(1:n)) :only select those elements that are under anti-diagonal
   0   0   0   0   0   1
   0   0   0   0   1   1
   0   0   0   1   1   1
   0   0   1   1   1   1
   0   1   1   1   1   1
   1   1   1   1   1   1

This doesn't work in matlab or in 2 octave online interpreters I've tried - I've never seen = used in lambdas, it's not valid in Matlab. Did this work for you in octave? Is it new version syntax?

@HughNolan You are right in the current version of Octave it doesn't work(behavior of ndgrid has changed ). It worked in Octave 3.6.2. I will edit the post. In octave assignment can be done in expressions including lambdas. Some features of octave related to golfing is in Tips for golfing in Octave

@HughNolan Answer updated, you can try it online.

Nice thanks for the update, good to know about assignment in lambdas - a good push for octave!

JavaScript, 53 bytes
f=(n,s='',x=n)=>{while(n)s+=n--;return x?f(--x)+s:''}
Thanks Titus for saving me bytes!

At n>0 and x>0, the >0 is unnecessary. Can You save a byte with for(x=n;n;)s+=n--;?

PowerShell, 41 bytes
1..$args[0]|%{$a+=-join($_..1)};,$a-ne101

Try it online!
(7 bytes to handle the special case of 0 for input)
Loops from 1 up to the input $args[0], each iteration concatenates onto $a the result of a -join operation operating on the range from the current number $_ down to 1. Then, we turn $a into an array , and select those elements of the array that are -notequal to 101 (this filters out the 0 input). That's left on the pipeline and output is implicit.
NB -- Since strings in PowerShell (and .NET) are based on the StringBuilder class which is a char array, the maximum length we can get to is 2^31-1.  But, PowerShell on your desktop will likely run out of memory before then, and TIO has an output limit of 256 KiB, so the actual maximum value supported is quite a bit smaller than that.

0 is not exactly a special case, if the code will error, thats valid.

@devRicher Zero is indeed a special case, because it's smaller than the loop delimiter of 1. The code above won't error without the handling at the end, instead it will output 101 for input 0. Exiting with an error would actually be longer (but shorter yet would be not worrying about input 0 at all).

I see, yes, 101 is invalid.

QBIC, 25 bytes
:[a|[b,1,-1|A=A+_t!c$|}?A

Sample run:
Command line: 10
12132143215432165432176543218765432198765432110987654321

Explanation:
:           Get 'a' from the command line
[a|         FOR b=1; b<=a; b++
[b,1,-1|      FOR c=b; c>=1; c--
A=A+_t!c$|      Append c to the 'output buffer' A$
}           Close the FOR loops
?A          Print 'a'

Non-competing: five minutes ago, I taught QBIC to do implicit printing on exit of anything stored in Z$. That brings the code for this challenge down to 22 bytes 19 bytes since I've made the cast-to-string autotrim!
:[a|[b,1,-1|Z=Z+!c$

Scala, 22 bytes
1 to _ map(_ to(1,-1))

Returns a sequence of sequences of ints.
Usage:
val f:(Int=>Seq[Seq[Int]])=1 to _ map(_ to(1,-1))
println(f(6))

Ungolfed:
n=>1 to n map(i=>i to 1 by -1)

Explanation:
1 to _      //create a Range from 1 to the argument of this function
map(        //map each element to...
  _ to(1,-1)  //a range from the number to 1, in steps of -1
)

bash, 69 bytes
f()([ $1 = 0 ]||(echo -n $1;f $[$1-1]));[ $1 = 0 ]||($0 $[$1-1];f $1)

f is a recursive function, and the entire script is recursive too.
Edit: @DigitalTrauma posted an improved version of this, which you can see in his comment on this answer. I'm not going to take the time to modify the answer, since he also posted a completely different bash solution, using brace expansion, that blows this answer away!

Some minor optimizations: f()((($1))&&printf $1&&f $[$1-1]);(($1))&&$0 $[$1-1];f $1.  Brace expansions make it much shorter though :)

@DigitalTrauma Thank you. Btw, I had tried using brace expansions, but couldn't shorten the code enough, since I didn't know that bash accepted {m..n} with m>n. That was actually something I was going to check out today.  Now I don't have to :)

Ruby, 37 34 bytes
->n{a=p;(1..n).map{|i|p a=[i,a]}*''}

Saved 3 bytes thanks to G B.

Even better (34 bytes): ->n{a=p;(1..n).map{|i|a=[i,a]}*''} using an accumulator initialized with nil and growing a nested array which is flattened all together at the end.

Very clever! Added it.

W j f, 3 bytes
It's actually pretty trivial in W ...
M_M

Explanation
a      % Take an input, say 3
     M % Identity map every item in numeric value 3
       % Since it is prohibited, a range is generated,
       % namely [1 2 3]
 a M   % For every item in [1 2 3]:
       % Note that single items are 1, 2, and 3, *not* the whole list
  a    % Generate a range from 1 to that number: [[1] [1 2] [1 2 3]]
    _  % Reverse for lists: [[1] [2 1] [3 2 1]]

Flag:f % Flatten the list: [1 2 1 3 2 1]
Flag:j % Join the list: 121321
```

Gosh dang, I never knew you answered this in W.

Keg, 11 bytes (SBCS)
Now I realized that Keg is pretty hard to use...
¿Ï_^'(Ï_')"

Try it online!

Vyxal, 5 bytes
ɾɾRṅṅ

Try it Online!
Tied with first :(
Explained
ɾɾRṅṅ
ɾɾ    # range of range of [1...input]
  R   # reduce (reverse each of list)
   ṅṅ # join by nothing twice

Python 2, 58 Bytes
print[[a for a in range(b+1,0,-1)]for b in range(input())]

Or, if the output of the above is not allowed, then the following code for 59 Bytes:
for i in range(input()+1):
 for j in range(i,0,-1):print j,

05AB1E, 6 bytes
LR.sJJ

Uses the CP-1252 encoding. Try it online!
         # Implicit input
 L       # Push [1, 2, ..., n]
  R      # Reverse
   .s    # Get suffixes
     JJ  # Join twice
         # Implicit output

Batch, 68 bytes
@for /l %%i in (1,1,%1)do @for /l %%j in (%%i,-1,1)do @cmd/cset/a%%j

Fortunately not printing newlines only costs 5 bytes.

Java: 141 chars
void c(int in,StringBuilder s){for(int i=1;i<=in;i++){for(int j=i;j>0;j--){s.append(Integer.toString(j));}}System.out.println(s.toString());}

Using c(6,new StringBuilder());:

121321432154321654321

There are many ways you can golf this submission: 1) use a shorter name instead of in 2) use System.out.print instead of println, and you can in your first for-loop do int i=1,j so that you can leave the int out from the second for-loop

Python, 80 bytes
r=''.join;lambda b:r([r([`i`for i in range(1,a+1)][::-1])for a in range(1,b+1)])

You can easily test this by pasting the above code into a repl and hitting enter, then typing _(6) or whatever input you want to give.

C, 52 bytes
Based on cat's existing answer:
i,j;f(n){j=++i;while(j)printf("%d",j--);i-n?f(n):0;}

Call with:
int main()
{
    f(6);
}

Clojure, 94 84 74 bytes
-10 bytes by eliminating the redundant for.
-10 bytes by eliminating the let.
Still long, but -20 bytes is nice.
#(loop[r 1 a""](if(> r %)a(recur(inc r)(str a(apply str(range r 0 -1))))))

Generates the reversed range, and concats it to the accumulator, then loops again while necessary.
Ungolfed:
(defn negative-order [n]
  (loop [r 1
         a ""]
    (let [s (apply str (range r 0 -1))]
      (if (> r n)
        a
        (recur (inc r) (str a s))))))

Clojure, 57 bytes
#(apply str(reductions(fn[s i](str(inc i)s))""(range %)))

reductions is perfect for incrementally producing outputs like this.

Stacked, noncompeting, 20 bytes
~>~>reveach flat''#`

Try it online!
I think a few of the features used in this answer were made after this challenge.
Explanation
~>~>reveach flat''#`
~>                    range from [1, n]
  ~>                  vectorized range [[1,1], [1,2], ..., [1, n]]
    reveach           reverses each segment
            flat      flatten
                ''#`  join by nothing

Java, 99 bytes
void f(int a){int[]f=new int[2];while(++f[0]<=a){f[1]=f[0];while(f[1]>0)System.out.print(f[1]--);}}

EDIT 1: Saved few bytes by changing it from a full program to a function.
Ungolfed:
void f(int a) {
    int[] f = new int[2];
    while (++f[0] <= a) {
        f[1] = f[0];
        while (f[1] > 0) System.out.print(f[1]--);
    }
}

You could save a few bytes by making a function instead (e.g. void f(int i){}).

You can save some bytes by using for-loops instead of whiles, a Java 8 lambda instead of Java 7 method, and two integers instead of an integer array: a->{for(int f=0,g=0;++f<=a;)for(g=f;g>0;)System.out.print(g--);} (64 bytes) Try it here.

GolfScript, 12 bytes
~),(;{),(;}%

Try it online!

Japt -P, 5 bytes
õõ cÔ

Try it
õõ cÔ     :Implicit input of integer
õ         :Range [1,input]
 õ        :Range [1,each], giving a 2D-array
   c      :Flatten after
    Ô     :Reversing each
          :Implicitly join & output

Thunno 2 N, 3 bytes
RRṃ

Attempt This Online!
Same as Reversed Iota's, but with the N flag which joins the nested list.


text:
Busy Brain Beaver reboot
Introduction
I found a really interesting puzzle it was called Busy Brain Beaver. But it has been 3 years since the latest activity and there are some things I didn't like about it. So I decided to make a new one.
The Rules
I want this one to be more brainfuck focused:

Your goal is to make a brainfuck program that outputs the biggest number.
It has to output that number in finite time so you can't say +[+]. outputs infinity (it doesn't have to terminate ex: +.[+] is OK)
Your program can only be 500 useful characters(non-brainfuck characters don't count)
You can assume . outputs your number (in decimal notation).
Only the first output counts (so you can't say +[+.] outputs infinity)
You can't ask for input so , is ignored
This takes place in a special brainfuck environment:

There are an infinite amount of cell to the left and to the right.
All cells start at 0
All cells can hold any integer (so - at 0 becomes -1)

Give an approximation (lower bound) for which number your program would output (given an arbitrarily finite time) (if you are using a special notation please say which one or provide a link)
An explanation of your algorithm would be appreciated. (posting the formatted and commented version will be appreciated too)

Not a duplicate
It was marked as a possible duplicate of Largest Number Printable I think this is different because:

This question is brainfuck focused. And in largest number printable brainfuck isn't even allowed. Yes they are both a busy beaver. But if you think these two are duplicates then any two busy beavers are duplicates. The difference between a brainfuck contest and a non-brainfuck contest is really big. And before it got closed people seemed to have a lot of interest in this one.
The goal here is to output a long number not a lot of bytes

Leader Board (top 10)

Gabriel Benamy            2↑↑↑411
Mike Bufardeci            4277772 = 163*(162*162)
fejfo                     60762 = 246*247

I think without a character limit this is too broad because no matter what the current best answer is, I can copy it and add one + to the end to get an even better score. If recommend removing the section about "alternative goal" and adding a character limit.

I find the sandbox very useful for getting feedback on challenge ideas to fine tune them before posting.

@mbomb007, a better dupe target is http://codegolf.stackexchange.com/q/18028/194

I didn't know of the sandbox. Is it to late to use it now and post an edited question later?

+++++++[>+++++++<-]>.......................... etc til 500 instantly wins surely (or something close to it) Just tested it and got an output of 480 1s in a row

@fejfo No. Feel free to post in there and edit this question after, or post a new one if its significantly different.

Would just like to mention that the modifications to brainfuck you are describing are very similar to P''.

@Alfie Goodacre the goal is not to have as many ones in a row as possible but to get the lagest number. And if I understand your code correctly it only outputs 7777777*....*7 that's easily beatable.

@fejfo I was pointing out the lack of clarity, as far as I am concerned the number 1.1(recurring)e479 is a pretty big number

@AlfieGoodacre 1.1(recurring)e479 is beated by something like 3↑↑4 (3^7,625,597,484,987 and I made a program for chained arrow notation

Relevant

What counts as the number? The output (1 is 49), or the value for the pointer (0x01 is 1)?

@KritixiLithos With output number I meant the value of the cell where the pointer is at the  .  comment

At this point, anything higher than what I provided will be purely theoretical, but you can test your algorithms by converting everything to COW and testing it here.  + = MoO, - = MOo, < = mOo, > = moO, [ = MOO, ] = moo, . = OOM

I suggest using this stack snippet for the leaderboard even though it may not work with the theoretical answers that will surely roll in.

@MikeBufardeci does it work with arrow notation ect?

@GabrielBenamy does COW need a space between commands?

No, spaces are considered comments.

@fejfo I can't imagine it does, but I'm sure you could modify it to compare arrow numbers to each other, and assume that any number with an arrow is larger than a number without.

@MikeBufardeci it's probebly not worth the time to update the code every time a new notation is used. I think I will just keep updating it regularly.

@fejfo I hope that arrow notation will be sufficient for all answers but it is up to you to decide how to update the scoreboard.

@GabrielBenamy I tried to get the converting too cow thing but I can't get it to work not sure if it is because I made a mistake or if the program simply takes to long to complete

Here's my answer with two leading + signs

@trichoplax why was this closed? Didn't I make clear why it was different?

@Peter Taylor can I just ask you all why you think this is a duplicate? (So you can explain to me how Largest Number Printable removes the need for my contest or I can explain to you why it is necessary)

@Easterly Irk can I just ask you all why you think this is a duplicate? (So you can explain to me how Largest Number Printable removes the need for my contest or I can explain to you why it is necessary)

@george can I just ask you all why you think this is a duplicate? (So you can explain to me how Largest Number Printable removes the need for my contest or I can explain to you why it is necessary)

@Flp.Tkc can I just ask you all why you think this is a duplicate? (So you can explain to me how Largest Number Printable removes the need for my contest or I can explain to you why it is necessary)

@Mego can I just ask you all why you think this is a duplicate? (So you can explain to me how Largest Number Printable removes the need for my contest or I can explain to you why it is necessary)

Where on Earth do you get the idea that BF is prohibited in the earlier question?

@Peter Taylor "You can use any language in which digits are valid characters (so that not using them is a real restriction);"

@PeterTaylor And with only a 100 bytes brainfuck is completely useless compared to other languages.

Since the restrictions in the previous challenge don't apply to BF, I can see why this might be seen as a duplicate, since it appears all the answers here could be posted there. However, since you pointed out that languages without numbers are explicitly forbidden in that challenge, it seems that either that restriction should be removed or this challenge should be reopened. I'm not sure which makes more sense.

@trichoplax I think reopening this one makes more sense because the other one has a a limit of 100 bytes which would have to be raised which would make all the answer that were already given useless. (And brainfuck is useless against higher level languages)

@trichoplax, removing the restriction makes more sense. Firstly, because it's so badly worded that I thought it was intended to say "This question doesn't ban languages which can use digits" rather than "This question bans languages which don't use digits". Secondly, because having one question for hundreds of languages which use digits and then one question per language which doesn't is a crazy asymmetry, and having two questions splitting on uses/doesn't would also be bizarre.

Discussion on meta

22222222... (65536 twos) = 2↑↑↑4
Before I begin, this is not the largest number expressible using 500 bytes of New Brainfuck.  It's simply where I gave up trying to wrap my head around how big the numbers were getting.  This answer only uses 93 bytes and is therefore not the largest number, but it's proof of concept that mind-bogglingly large numbers are possible.
+++[->++[->+>+<<]>>[-<<+>>]+<[->[-<<[->>>+>+<<<<]>>>>[-<<<<+>>>>]<<]>[-<+>]<<]>[-<+>]<<<]>>.

This is a modification of the exponentiation algorithm in Brainfuck.
This number is so large, it's almost impossible to describe in human terms.  It isn't sufficient to say "the number has this many digits" because it has more digits than particles in the universe.  In fact, the number of digits this number contains has more digits than the number of particles in the universe.
Let this number be x, and let f(0) = x.  Recursively define f(n) = floor[log10[f(n-1)]].  The first n which is smaller than 1 googol is over 10,000.
This answer is 93 bytes.
If we removed removed a single leading +, the result would be 65536 = 2222.  Removing another + gives us 4.  This means that if we add another +, we would get a number tower with 2↑↑↑4 twos, which would be 2↑↑↑5.  That answer would be 94 bytes.  If I were to add another 406 plus signs to this, we would get 2↑↑↑411, which is mind-bogglingly big.  Instead, if  I were to add yet another outer loop, I could probably get something close to 2↑↑↑↑380.  For the record, 2↑↑↑↑3 = 2↑↑↑4, and 2↑↑↑↑4 dwarfs 2↑↑↑4 much the same way that 2↑↑↑4 dwarfs 65536.  In fact, it may just be possible to actually get close to Graham's Number using 500 bytes of brainfuck.

you can go way past Graham's number in 500 bytes. I tried to make chain arrow notation my rough draft was around 350 bytes!

I would probably give this code credit for 2↑↑↑411 ? what does the rest think?

Well sure, but my brain hurt and the COW interpreter didn't even print this number (which I suspect may be smaller than I thought)

4277772 = 163*(162*162)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<-]<-]>>.

As a reaction to the 60762 solution this is another simple solution. Here we multiply just like that answer but inside of another loop. I am somewhat concerned that I am interpreting this nested loop incorrectly but I think that this is correct and the output would be 4,277,772.
The loop looks like the code below except the first + is replaced with 163 +s and the other two +s are replaced with 162 +s:
+[>+[>+<-]<-]>>.

499
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.

The naive approach, increments the starting cell 499 times before outputting that cell and terminating. I would submit a more complex answer, but there are no online testbeds for this variant of brainfuck and I do not want to post an answer that doesn't work.

I'm currently trying to set up a git hub pages for a custom interpreter. But I have never used git hub pages before so I might fail.

I probably won't be making that interpreter since Gabriel Benamy suggested the COW interpreter and git for windows doesn't want to install.

60762 = 246*247
As a reaction on the 499 solution I will do an other very simple solution it just multiplies 2 numbers
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<-]>.

how it works is pretty self explanatory it uses the standard multiplication loop
++[>+++<-]>.
would be 2*3 = 6

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Number of prime knots with n crossings
A prime knot is:

a non-trivial knot which cannot be written as the knot sum of two non-trivial knots.

Explanation of a knot-sum: put the two knots adjacent,

... then draw two lines between them, to the same strand on each side, and remove the part between the lines you just drew. This composition of two knots will form a new, non-prime knot.

Here are all prime knots with 7 or fewer crossings (the Unknot is not prime):

You need to output the number of unique prime knots for a given number of crossings.
1   0
2   0
3   1
4   1
5   2
6   3
7   7
8   21
9   49
10  165
11  552
12  2176
13  9988
14  46972
15  253293
16  1388705

I don't think the values are known for inputs larger than 16, but if given such an input, your code would need to find the correct result given enough time.
OEIS - A002863

Perhaps someone will find this Mathematica library useful.

Mathematica + KnotTheory`, 13 bytes
NumberOfKnots

I didn't know this built-in function existed when I commented that the package might be useful. Everyone else had an equal chance to find it, since I commented about the library. I found it in the list of Lightly Documented Features. Still, I won't accept this answer, since I want to see answers by other people.

Seeing as the documentation is very poor are you sure this works for numbers greater than 16?

@WheatWizard No, I'm not sure how to tell. It would take way too long to run to completion. Is there a way to find out how it's implemented?

Have you tried running it?  It might just return an error.  I can't run mathematica right now but I would check if it stalls when you attempt to run it.

@WheatWizard I can't check either. Let me know if you try it.

I actually looked through the source code for a bit, searching for it, but I didn't find the definition. The repository is publicly available. http://katlas.math.toronto.edu/svn/KnotTheory/trunk/KnotTheory/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Find largest product of longest subsequence between min and max
Input:
A non-empty sequence of integers greater than zero, the length of which is greater than 1.
Output:
The largest product of all elements of the longest subsequence between the minimum and maximum elements of sequence including themselves.
Note:
Because the minimum and maximum elements can be repeated, then to a definite answer necessary to find the longest possible subsequence, at one end of which is a minimum and at the other end maximum elements of the sequence. If there is multiple longest subsequences then choose subsequence with largest product.
Examples:
1st example:
Input: [5, 7, 3, 2, 1, 2, 2, 7, 5]
Output: 42
Explanation:
min == 1, max == 7. There is 2 possible subsequences with min and max on ends: [1, 2, 2, 7] and  [7, 3, 2, 1]. Their length is equal, so comparing products: 7*3*2*1 == 42 and 1*2*2*7 == 28. Because 42 >= 28, answer: 42.
2nd example:
Input: [1, 2, 2, 2, 4, 3, 3, 1]
Output: 32
Explanation:
min == 1, max == 4. 2 subsequences: [1, 2, 2, 2, 4] and [4, 3, 3, 1]. Length of [1, 2, 2, 2, 4] is greater than length of [4, 3, 3, 1]. product: 1*2*2*2*4 == 32 => answer is 32.
3d example:
Input: [1, 2, 3, 4, 3, 3, 1]
Output: 36
Short explanation:
min == 1, max == 4. 2 subsequences: [1, 2, 3, 4] and [4, 3, 3, 1]. 1*2*3*4 == 24, 4*3*3*1 == 36, 36 >= 24 => answer is 36.
4th example:
Input: [2, 2, 2]
Output: 8
Explanation:
min == 2, max == 2. 2 different subsequences: [2, 2] and [2, 2, 2]. Length of [2, 2, 2] is greater than length of [2, 2]. product: 2*2*2 == 8 => answer is 8.
More (random) examples:
>>>[7, 2, 3, 6, 8, 6, 2, 5, 4, 3]
288
>>>[3, 3, 8, 9, 1, 7, 7, 2, 2, 4]
9
>>>[3, 2, 6, 5, 4, 1, 8, 8, 7, 9]
4032
>>>[7, 4, 2, 8, 8, 3, 9, 9, 5, 6]
31104

Check your solution:
Here is Python 3 lambda (788 bytes), which satisfies the requirement of the task:
lambda O: __import__('functools').reduce(__import__('operator').mul,O[[[slice(O.index(max(O)),len(O)-1-O[::-1].index(min(O))+1),slice(O.index(min(O)),(len(O)-1-O[::-1].index(max(O)))+1)][__import__('functools').reduce(__import__('operator').mul,O[O.index(min(O)):(len(O)-1-O[::-1].index(max(O)))+1],1)>=__import__('functools').reduce(__import__('operator').mul,O[O.index(max(O)):len(O)-1-O[::-1].index(min(O))+1],1)],slice(O.index(min(O)),(len(O)-1-O[::-1].index(max(O)))+1),slice(O.index(max(O)),len(O)-1-O[::-1].index(min(O))+1)][(len(range(O.index(min(O)),(len(O)-1-O[::-1].index(max(O)))+1))>len(range(O.index(max(O)),len(O)-1-O[::-1].index(min(O))+1)))-(len(range(O.index(min(O)),(len(O)-1-O[::-1].index(max(O)))+1))<len(range(O.index(max(O)),len(O)-1-O[::-1].index(min(O))+1)))]],1)

Winner:
Shortest solution will win. All programming languages accepted.
P.S.: I will be happy to the explanations of your solutions

Jelly, 14 bytes
.ịạ/;L;P
ẆÇ€ṀṪ

Try it online!
How it works
ẆÇ€ṀṪ     Main link. Argument: A (array)

Ẇ         Window; generate all substrings of A.
 Ç€       Map the helper link over the substrings.
   Ṁ      Take the maximum.
    Ṫ     Tail; select the last element.

.ịạ/;L;P  Helper link. Argument: S (array / substring)

.ị        At-index 0.5; select the last and first element of S.
  ạ/      Reduce by absolute difference.
    ;L    Append the length of S.
      ;P  Append the product of S.

Jelly, 15 bytes
NMpMr/€LÐṀịµP€Ṁ

TryItOnline!
How?
NMpMr/€LÐṀịµP€Ṁ - Main link: list of integers, L
           µ    - links to the left as a monadic chain with argument L
N               - negate elements of L
 M              - indexes of maximal elements (i.e. indexes of minimal elements of L)
   M            - indexes of maximal elements of L
  p             - Cartesian product of the min and max indexes
     /€         - reduce each list (all of which are pairs) with the dyad:
    r           -     range(a,b)  (note if a>b this is [a,a-1,...,b])
        ÐṀ      - filter keeping those with maximal
       L        -     length
          ị     - index into L (vectorises)   (get the values)
            P€  - product of a list for €ach
              Ṁ - maximum

Perl 6, 108 bytes
{max ([*] $_ for .[.grep(+.max(+*)) with (for .min,.max,.max,.min {.first($^a,:k).. .first($^b,:k,:end)})])}

R, 146 bytes
z=apply(expand.grid(which(max(x<-scan())==x),which(min(x)==x)),1,function(y)c(prod(x[y[1]:y[2]]),abs(diff(y))));max(z[1,which(z[2,]==max(z[2,]))])

Tricky challenge because of the length requirement. Also annoying because the would-be useful builtin which.max only returns the index of the first maximum it encounters, forcing me to use which(max(x)==x) instead... 3 times. Ohwell...
Readable:
x <- scan()

maxs <- which(max(x)==x)
mins <- which(min(x)==x)
q <- expand.grid(maxs,mins)
z <- apply(q,1,function(y){
  c(prod(x[y[1]:y[2]]), abs(diff(y)))
  })

max(z[1, which(z[2, ]==max(z[2, ]))])

PHP, 189 173 166 bytes
<?foreach($a=$_GET[a]as$p=>$b)foreach($a as$q=>$c)$b>min($a)|$c<max($a)?:$r[$d=abs($p-$q)+1]=array_product(array_slice($a,min($p,$q),$d));ksort($r);echo max(end($r));

similarly lazy but 33 bytes shorter (had to add 10 bytes to turn the snippet into a program):

Loop $p/$b and $q/$c through the array; if $b==min and $c==max,
add product of the sub-sequence to $r[sub-sequence length]
Sort $r by keys.
Print the max value of the last element.

Call in browser with array as GET parameter a.
Example: script.php?a[]=5&a[]=7&a[]=3&a[]=2&a[]=1&a[]=2&a[]=2&a[]=7&a[]=5

Mathematica, 122 bytes
(g=#;Sort[{#.{-1,1},Times@@Take[g,#]}&/@Sort/@Join@@Outer[List,Sequence@@(Union@@Position[g,#@g]&/@{Max,Min})]][[-1,-1]])&

Surprised how long this turned out to be. First generates the Cartesian product of the appearances of the minima and maxima (as per Jonathan Allan's Jelly answer), then computes the lengths of those runs and their products, and selects the appropriate one by taking the last element of the sorted results.

JavaScript, 187 bytes

f=
(l,M=Math,a=M.min(...l),z=M.max(...l),r=(m,n)=>[eval(l.slice(b=l.indexOf(m),c=l.lastIndexOf(n)+1).join`*`),M.abs(b-c)])=>(u=r(a,z),v=r(z,a),u[1]>v[1]?u[0]:v[1]>u[1]?v[0]:M.max(v[0],u[0]))

console.log([
  [5, 7, 3, 2, 1, 2, 2, 7, 5],
  [1, 2, 2, 2, 4, 3, 3, 1],
  [1, 2, 3, 4, 3, 3, 1],
  [2, 2, 2],
  [7, 2, 3, 6, 8, 6, 2, 5, 4, 3],
  [3, 3, 8, 9, 1, 7, 7, 2, 2, 4],
  [3, 2, 6, 5, 4, 1, 8, 8, 7, 9],
  [7, 4, 2, 8, 8, 3, 9, 9, 5, 6]
].map(a=>`[${a}] => ${f(a)}`).join`
`)


text:
Big numbers: Ultrafactorials
Ultrafactorials
The ultrafactorials are a sequence of numbers which can be generated using the following function:
$$a(n) = n! ^ {n!}$$
The resulting values rise extremely quickly.
Side note: This is entry A046882 in the OEIS. Also related are the hyperfactorials, a still quite huge, but a bit smaller sequence: A002109
Your task
Your task is to implement these numbers into your language. Your program will calculate the sum of all ultrafactorials from 0 up to inclusive n.
Input
Your program may only take one input: a number, which resembles the last \$a(n)\$ ultrafactorial to be added to the sum. The Input is assured to be positive or 0.
Output
Your output is all up to you, as long as there's the visible sum of the numbers somewhere.
Rules

You can assume all integers, therefore integer input, and using integer counting loops to produce some results.

Test cases
Input: -1
Output: Any kind of error (because -1! is undefined), or no handling at all

Input: 0
Output: 1

Input: 1
Output: 2

Input: 2
Output: 6

Input: 3
Output: 46662
Challenge
This is code-golf, so the answer with the least length in bytes wins!

Do we need to consider arbitrarily large integers? Or is it enough to handle the largest that the language's default data type (such as double) supports ?

The conversion in-code and output is up to you, the Input will be an integer though. @LuisMendo

Changing the rules after many people have answered isn't a nice thing to do either. Please use the Sandbox as advised whenever you want to submit a challenge.

05AB1E, 5 bytes
Code:
Ý!DmO

Explanation:
Ý       # Take the range [0, ..., input]
 !      # Map factorial over each element
  Dm    # Exponentiate each element to itself
    O   # Take the sum

Uses the CP-1252 encoding. Try it online!

L!DmO also works if you want to take off the "CP-1252 encoding" bit.

@MagicOctopusUrn No it doesn't. L!DmO> would, but returns $3$ for $0$, so it's invalid.

Mathematica, 19 bytes
Sum[n!^n!,{n,0,#}]&

Apologies for the extremely clear code  ;)

Using mathematica for mathematica - dick move :D

Jelly, 6 bytes
Try it online!
‘Ḷ!*`S // Main link: Argument n (integer)
‘      // Take n, increment by 1
 Ḷ     // Range from [0..n]
  !    // Calculates factorial for each [0..n]
   *`  // Raises each [0!..n!] to the power of itself
     S // Sum the resulting array

There is an increment atom, ‘, so R!*`S‘ saves a byte (I went for ‘Ḷ!*`S).

I actually was in the middle of editing before I saw your comment :P

I saw that too, good job.

5 bytes

R -  34  30 bytes
x=factorial(0:scan());sum(x^x)

vectorizing is nice
edit: saved 4 bytes thanks to @MickyT

you can shortened it a bit by moving you scan into the factorial x=factorial(0:scan());sum(x^x)

Perl 6, 41 38 37 bytes
{[+] ([**] [*](1..$_)xx 2 for 0..$_)}

{[+] ([**] ([*] 1..$_)xx 2 for 0..$_)}

{sum (($_**$_ with [*] 1..$_) for 0..$_)}

(Try it online.)
Explanation:

for 0 .. $_: For each integer from 0 to the input,
[*](1 .. $_) xx 2: calculate the factorial twice,
[**] ...: and exponentiate the two identical factorials.
[+] ...: Then sum all results of the loop.

Thanks to b2gills for 1 byte.

([*] …) can be written as [*](…) saving a byte

J, 15 12 bytes
Saved 3 bytes thanks to miles!
1#.i.^~@!@,]

Explanation
1#.i.^~@!@,]  input: y
          ,]  append y to list...
   i.         [0, y)
        !@    factorial each member
     ^~@      raise each to itself
1#.           perform summation

Test cases
   f =: 1#.i.^~@!@,]
   (,. f"0) i.4
0     1
1     2
2     6
3 46662
   (,. f"0) i.6
0           1
1           2
2           6
3       46662
4  1.33374e33
5 3.17504e249

   echo"1] _90]\":f 6x
190281878633201797429473437859705759836595323046380462211756876146775419721154680216391116
383660154937824558291984804764687140715927099993629348072943551413397410741069111169123658
220861477766905534108349401724389611558474171816216027733366046875815097164882588181826712
426524007417126023680300953790645455254723360874298622143752208989152655091222094594342956
890526202094068774356589887610542642450567071133028553816930267473112879050178461179814798
008667622200592591542432361632955904924276854403585221477449385731481108378608652069211835
448555831555820393949831627809528917004144455150642180845929102272754394116905511650997561
389917179995442329297103257850695109383021080317204810134810158543814178231002423431556657
737982683316707709406053569620116083909440177269311235173671447595521339849978144493268530
780365729831790064477684808893338190825461650933123545889305523546630119181308584140916288
912561260392366609493077363059677222110731132927863243720195975705161197786520981159422881
575250362836779593393897664990291828935858671453835924398316498051705698128484688847592380
831018330553151156822298060174230201841578757499203145955456593022852288527824268115043999
037373974753999860179933517198889966353093307592136928730661270863274130109304971274296438
682725017433937245229524959283895094220677649257613358344409711070780405579776000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000003175042373780336892901667920556557182493442088021222004926225128381629943118937129
098831435345716937405655305190657814877412786176000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001333735776850284124449081472890438

1#.i.^~@!@,] shaves a few more bytes off.

@miles Oh, cool. I didn't know 1#. performs summation. If that's not a tip already, you should definitely add it!

Ruby, 64 66 bytes
->n{(o=(1..n).map{|i|a=(1..i).inject(:*);a**a}.inject(:+))?o+1:1}

Added two characters for the off-by-one bugfix (will look into shortening the inject calls later).

I'm not good with Ruby but couldn't you fix this with a=(0..i) instead of a=(1..i)?

@Timtech Expect injecting zero into a multiplication doesn't do anyone any good :(

Right, I guess adding +1 is the best solution.

@GB Applied trivial fix for n=0 case.

Cheddar, 44 37 bytes
n->(0|>n=>(i,a=(1|>i)/(*))->a**a)/(+)

Thank goats for reduce operator! I think it would've been good idea to add factorial
Try it online
Ungolfed
n -> ( 0|>n => (i, a=(1|>i) / (*)) -> a ** a) / (+)

Explanation
Note: A little outdated, will fix
n ->           // Input
( 0 |> n) =>   // Run below for each of [0, n]
    (
      i,           // Input
      a =          // Let's keep n! in this variable `a`
         (1 |> i)  // Range from [1, n]
         / (*)     // Multiply all the items of that range
                   // `/` is reduce `(*)` is multiplication function
    ) ->
    a ** a         // A to the power of A
) / (+)        // Sum all results

Isn't thank god a little bit presumptuous here? :D

@flawr ok. Fixed :P

Haha, better, perhaps one of the few legit usages of goat we've seen around here recenly :)

MATL, 7 bytes
Q:Ygt^s

Try it online!
Explanation
Q         % Take input n implicitly. Add 1
 :        % Range [1 2 ... n+1]
  Yg      % Gamma function, element-wise. This gives [0! 1! ... n!]
    t^    % Rise result to itself, element-wise
      s   % Sum all values. Implicitly display

PHP, 49 bytes
for($f=1;$i<=$argv[1];$f*=++$i)$s+=$f**$f;echo$s;

INF for n>5 on a 64 bit system.
for large numbers, 70 bytes
while($i<=$argv[1])$s=gmp_add($s,gmp_pow($f=gmp_fac($i++),$f));echo$s;

requires PHP to be compiled with --with-gmp

JavaScript (ES7), 38 bytes
f=(n,a=1,i=0)=>i>n?0:a**a+f(n,a*++i,i)

@fəˈnɛtɪk Sorry, force of habit.

R, 42 35 bytes
Now that I've read the question properly, I've put the sum in.
This requires the gmp (multiple precision arithmetic) library to be available.  This allows for large numbers to be handled.  Otherwise anything over 5 returns INF.
This is implemented as a unnamed function to avoid the as.character that would be required to output to STDOUT through cat
function(x)sum((i=gmp::factorialZ(0:x))^i)

Example run
> f <- function(x)sum((i=gmp::factorialZ(0:x))^i)
> f(5)
Big Integer ('bigz') :
[1] 3175042373780336892901667920556557182493442088021222004926225128381629943118937129098831435345716937405655305190657814877412786176000000000000000000000000000000000000000000000000000000000000000000000000000000000000001333735776850284124449081472890438
> f(6)
Big Integer ('bigz') :
[1] 190281878633201797429473437859705759836595323046380462211756876146775419721154680216391116383660154937824558291984804764687140715927099993629348072943551413397410741069111169123658220861477766905534108349401724389611558474171816216027733366046875815097164882588181826712426524007417126023680300953790645455254723360874298622143752208989152655091222094594342956890526202094068774356589887610542642450567071133028553816930267473112879050178461179814798008667622200592591542432361632955904924276854403585221477449385731481108378608652069211835448555831555820393949831627809528917004144455150642180845929102272754394116905511650997561389917179995442329297103257850695109383021080317204810134810158543814178231002423431556657737982683316707709406053569620116083909440177269311235173671447595521339849978144493268530780365729831790064477684808893338190825461650933123545889305523546630119181308584140916288912561260392366609493077363059677222110731132927863243720195975705161197786520981159422881575250362836779593393897664990291828935858671453835924398316498051705698128484688847592380831018330553151156822298060174230201841578757499203145955456593022852288527824268115043999037373974753999860179933517198889966353093307592136928730661270863274130109304971274296438682725017433937245229524959283895094220677649257613358344409711070780405579776000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003175042373780336892901667920556557182493442088021222004926225128381629943118937129098831435345716937405655305190657814877412786176000000000000000000000000000000000000000000000000000000000000000000000000000000000000001333735776850284124449081472890438

f(9) will runs pretty well, but fills up a number of pages.  A few hundred or so and 2,017,528 digits.  f(10) kills the session on my machine.

I think the reason its different than the other answers is because you're supposed to return the sum from 0!^0! to N!^N!. But this is easy to amend by changing to factorialZ(0:x). Is there a specific reason to not use the base::factorial() function?

@JarkoDubbeldam Thanks for the catch.  Need to read the questions better :).  I'm using gmp::factorialZ to handle the big numbers.

Python 2, 73 72 bytes
import math
lambda n,f=math.factorial:sum(f(i)**f(i)for i in range(n+1))

Haskell, 67 56 bytes
Note that this submission was made before the rules that banned builtins were removed.
p=product
a n=sum[p[x|x<-[p[1..i]],_<-[1..x]]|i<-[0..n]]

For example:
*Main> a 0
1
*Main> a 1
2
*Main> a 2
6
*Main> a 3
46662
*Main> a 4
1333735776850284124449081472890438
*Main> a 5
3175042373780336892901667920556557182493442088021222004926225128381629943118937129098831435345716937405655305190657814877412786176000000000000000000000000000000000000000000000000000000000000000000000000000000000000001333735776850284124449081472890438

Pyth - 9 8 bytes
s^Rd.!Mh

Test Suite.

PARI/GP, 19 bytes
n->sum(k=0,n,k!^k!)

Was just about to post this. Glad I checked first.

GameMaker Language, 97 bytes
Main function (52 bytes)
for(a=0;a<=argument0;a++)b+=power(f(a),f(a))return b

Function f (45 bytes)
a=argument0 if!a return 1else return a*f(a--)

Dyalog APL, 10 bytes
(+/!*!)0,⍳

How?
⍳ range of input
0, preceded with 0
!*! apply x! ^ x!
+/ sum

* and ! are scalar functions, so use arrays: +/*⍨!0,⍳⎕ or (+/!*!)0,⍳ if you really want a train.

Golfscript, 41 bytes
{.{,{1+}%{*}*}{;1}if}:f;~.,\+{.f\f?}%{+}*

Try it online!

Thunno +, \$ 7 \log_{256}(96) \approx \$ 5.76 bytes
RFDz.^S

Attempt This Online!
Explanation
RFDz.^S  # implicit input
         # + flag adds one
R        # range from 0
 F       # factorial of each
   z.    # for each number:
  D  ^   #  raise it to the power of itself
      S  # sum the resulting list
         # implicit output

vemf, 3 5 bytes
▲↕!┴^

Explanation
▲↕    ' range [0, α)
   ┴  ' run this function:
    ^ '   exponentation
      ' with this for both inputs:
  !   '   factorial of each element in range

e.g. 3▲↕!┴^+ – try it online

Nice language!  Note though that you need to sum the ultrafactorals from 0..n, not just return the ultrafactorial of n.

@DominicvanEssen oops! fixed

Python 2, 82 Bytes
x=input()
s=0
for z in range(x):
 t=1
 for i in range(z+1):t*=i+1
 s+=t**t
print s

Have you tried summing a list comprehension?

You've only used x once, so you could use range(input()) this would remove a few bytes

Wonder, 33 bytes
@sum(->@^ f\prod rng1#0f)rng0+1#0

Usage:
(@sum(->@^ f\prod rng1#0f)rng0+1#0)3

Explanation
rng0+1#0

Create inclusive range from 0 to input.
->@^ f\prod rng1#0f

Map over the range with a function that 1) calculates the factorial of the item, 2) stores the result to f, and 3) calculates f^f.
sum

Sum.

Mathematica, 19 bytes
Sum[a!^a!,{a,0,#}]&

Anonymous function. Takes a number as input, and returns a number as output.

We can't use factorial or exponentiation builtin.

Pyke, 11 bytes
hFSBD]1*B)s

Try it here!
hF          -  for i in range (0, input+1)
  SB        -     product(range(1, i+1)
    D]1*    -    [^]*^
        B   -   product(^)
          s - sum(^)

Fun fact: Pyke doesn't have a factorial built-in because SB is only 2 bytes!

Haskell, 43 bytes
b n|f<-product[1..n]=f^f
a n=sum$b<$>[0..n]

Usage example: a 3-> 46662.
b calculates a single ultrafactorial and a sums all ultrafactorials from 0 to n.

JavaScript (ES7), 44 bytes
g=n=>n?(f=a=>a?a*f(a-1):1)(n)**f(n)+g(n-1):1

TI-Basic, 13 bytes
sum(seq(A!^A!,A,0,Ans

P.S. You can replace sum(seq( with Σ( if you have a newer operating system (no size change).

Ruby 2, 41 bytes
->n{(1..n).reduce(s=1){|t,i|t+(s*=i)**s}}

Awesome!  Very clever the way it initializes s at the same time as passing it as the initial t value to reduce/inject.

Can be golfed one more character to ->n{((t=s=1)..n).map{|i|t+=(s*=i)**s};t} or ->n{t=s=1;(1..n).map{|i|t+=(s*=i)**s};t}

Husk, 7 bytes
→ṁo´^Πḣ

Try it online!
→          One plus
 ṁ         the sum of
     Π     x!
    ^      to the power of
   ´       itself
 ṁo        for each x in
      ḣ    the range from 1 to
           the input.

It would be slightly more correct to use ṁo´^ΠΘḣ, actually adding 0 into the range, but since 0!^0!=1^1=1, this works too.

Whispers v3, 77 69 bytes
> Input
> 0
>> L!
>> … 2 1 3
>> L*L
>> Each 5 4
>> ∑6
>> Output 7

Try it online!
Yet another 69 byte answer thanks to Leo.

Using … instead of the first Each is shorter: https://tio.run/##K8/ILC5ILSo2@v/fTsEzr6C0hMtOwYDLzk7BRxFEPmpYpmCkYKhgDBbS8gFRronJGQqmCiZg@Y6JZiDav7QEqFfB/P9/YwA

That's new to me as well..

The documentation for Whispers v3 is still incomplete, but the tutorial for Whispers v2 has a complete list of "command lines", all still usable

Pyt, 5 bytes
ř!ṖƩ⁺

Try it online!
ř           implicit input; řangify
 !          factorial
  Ṗ         raise n to the nth Ṗower
   Ʃ        Ʃum
    ⁺       increment

Nibbles, 5.5 bytes
+~+.,$^;`*,

Attempt This Online!
-0.5 byte thanks to Dominic van Essen
+~+.,$^;`*,
+~          Add 1
  +         to the sum
   .        for each n in
    ,       range from 1 to
     $      input
        `*  of the product of
          , range from 1 to
            n
      ^     to the power of
       ;    itself

5.5 bytes...

@DominicvanEssen I'm dumb… Thanks!

Correction: 11 bytes -> 5.5 bytes

Argh… ATO still can't handle the byte counts properly…

Vyxal s, 4 bytes
ʀ¡:e

Try it Online!
ʀ  range [0, input]
¡  factorial (vectorizes)
:  duplicate list
e  exponentiate
s  sum

Arturo, 29 bytes
$=>[∑map..0&=>[^<=∏1..&]]

Try it

Stax, 10 bytes
Ç╔Ñst(jÖ3l

Run and debug it
This is PackedStax, which unpacks to the following 11 bytes:
R{|Fc#}m|+^

Run and debug it
R{    }m    # map over range 1..input
  |F        # push n!
    c       # dup
     #      # exponentiate
        |+  # sum
          ^ # increment (deals with 0 case)

C (gcc), 71 70 bytes
-1 byte thanks to @ceilingcat!
i,j,k;a(n){for(j=0;~n;--n,j+=pow(i,i))for(i=k=1;n/++k;)i*=k;return j;}

You can test it online here (Try It Online! seems to lack the pow function).
88 87-byte solution without builtins:
i,j,k,e;a(n){for(j=0;~n;--n,j+=e){for(i=k=1;n/++k;)i*=k;for(e=k=i;--k;)e*=i;}return j;}

Try It Online!

Python 3, 70 bytes
import math
x=lambda n,f=math.factorial:1if n==0else f(n)**f(n)+x(n-1)

Try it online!

67

Thunno 2 S, 4 bytes
ĖwD*

Try it online!
Explanation
ĖwD*  # Implicit input
Ė     # Push [0..input]
 w    # Factorial of each
  D*  # To the power of itself
      # Implicit output of sum

C#, 79 bytes with console output
n=>{int i=1,j=1;for(;i<=n;i++)j*=i;System.Console.Write(System.Math.Pow(j,j));}

C#, 64 bytes as a return
n=>{int i=1,j=1;for(;i<=n;i++)j*=i;return System.Math.Pow(j,j);}

Actually 11 10 bytes
1+r`!;ⁿ`MΣ

How it works
Program takes implicit input, implicit print at EOF
1+          Add one to the input n+1
  r         Create a range (0,1,..,n)
   `   `    Create a function between the two `
    !       Factorialize the current stack item
     ;      Duplicate the current stack item
      ⁿ     Power a,b from the current stack item
         M  Map the function across the stack top item
          Σ Sum the stack together

Racket 54 bytes
(for/sum((i(+ 1 n)))(let((t(factorial i)))(expt t t)))

Ungolfed:
#lang racket
(require math)

(define (f n)
  (for/sum ((i (+ 1 n)))
    (let ((t (factorial i)))
      (expt t t))))

Testing:
(f -1)
(f 0)
(f 1)
(f 2)
(f 3)

Output:
0
1
2
6
46662

Brachylog, 12 bytes
y:{$!F:F^}a+

Try it online!
Explanation
y                 The list [0, ..., Input]
 :{      }a       Apply the predicate below to each element of that list
           +      The output is the sum of the results

   $!F              F is the factorial of the input
      :F^           Output = F^F

APL (Dyalog), 11 bytes
+/(*⍨∘!0,⍳)

Try it online!

This function train is equivalent to {+/*⍨!0,⍳⍵}, which is a straight forward implementation

Japt, 8 6 bytes
òÊx_pZ

Test it

Explantion
Implicit input of integer U3
ò

Create an array of integers from 0 to U, inclusive.[0,1,2,3]
Ê

Get the factorial of each integer in the array.[1,1,2,6]
_

Map over the array.
pZ

Raise each element (p) to the power of itself (Z).[1,1,4,46656]
x

Reduce by addition and implicitly output the result.46662

In 2023, this is 5 bytes òÊ®pZ -x, or if the range was exclusive it would be 4 ÊpUÊ -mx

Perl 6, 38 bytes
{[+] map {my \a=[*] 1..$_;a**a},0..$_}

Try it online!

31 bytes

05AB1E, 8 bytes
ƒN!N!m}O

Try it online!

Factor + math.factorials math.unicode, 29 bytes
[ [0,b] [ n! dup ^ ] map Σ ]

Try it online!
  [0,b]                      ! range from 0 to input inclusive
        [          ] map     ! map over each element in the range
          n!                 ! factorial
             dup ^           ! raised to itself
                         Σ   ! sum

Swift, 129 106 bytes
import Darwin
var s={(0...$0).map{let x=Double($0<1 ?1:(1...$0).reduce(1,*))
return pow(x,x)}.reduce(0,+)}

Fatal-errors on n < 0, inf for n >= 6. Probably macOS-only due to needing to import Darwin to access the pow(_:_:) function. (Using Darwin instead of Foundation saved both 4 bytes and my sanity.)
When implementing the factorial, I had to hard-code the value for 0 in order to bypass Fatal error: Range requires lowerBound <= upperBound.
There's a space to the left of the ? due to 1 not being optional. We don't need the space to the right.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
bROKEN cAPSLOCK kEY fIASCO
Some of your employees have broken capslock keys and you're too cheap to replace them. Help them out by creating the shortest program possible to correct their work! Simply convert each character in a given string from uppercase to lowercase and vice-versa... but there's a twist!
You're also very excited for Christmas! So you're going to leave in a tiny "bug" that doesn't correct letters which are within sequences of Christmas (case-insensitive).
Input
For input you will use one single string (or array of bytes) that may contain newlines and ascii between 0x20 and 0x7e ( - ~). You don't need to worry about carriage returns or any other characters being in the string.
Output
The output should contain only the provided string with the upper and lowercase characters swapped (and the Christmas bug of course!). It can contain up to one extra trailing whitespace.
Christmas Bug
Let's explain this with an example:
Input: i CAN HARDLY WORK LIKE THIS please GET ME A NEW KEYBOARD FOR cHRISTMAS
Output: I Can HaRdly work lIke thiS PLEASE geT Me A new keyboard for ChriStmas

can contains "c" which is the first letter of Christmas, so that isn't changed. The next letter in Christmas is "h", which is in hardly (which also contains the "r"), so that isn't changed, etc. Christmas itself only has one letter unchanged because by the time the code reaches there, it's actually looking for "s", not "c".
Once the sequence is found, it should start all over again at "c", and begin iterating through Christmas once more. So ChristmasChristmas would be left unchanged.
Test Cases
Input: Hello World!
Output: hELLO wORLD!

Input: I like pie :)
Output: i LIKE PIE :)

Input: hELP my KeYboarD
       iS BROKEN
Output: Help MY kEyBOARd
        Is broken

Input: cHRISTMAS IS COMING REALLY SOON!
Output: cHRISTMAS is Coming really soon!

Input: C is the first letter in cHRISTMAS
Output: C IS ThE FIrST LETTER iN ChriSTMAS

Winner
This is code-golf so the shortest answer wins!

That 'no built ins which solve most the challenge' is a pretty strange restriction. And is 'swap case' really going to cause that many issues when half the challenge is identifying which letters aren't in 'christmas'?

Related: I am passive aggressive and want to insult my boss without him finding out

@ATaco, I added it last-minute because of feedback on the sandbox, I agree though so I've removed it.

Also, Test case 3, you swapped the first h, when that's in Christmas.

@ATaco, it looks for Christmas sequencially, so "h" is ignored until it finds "c", then it looks for "h", then "r", etc.

Ah, my mistake. Must have misread the spec.

What if the string is long and it contains the Christmassequence repeated (a newcafters` and so on)? Do we have to consider that, or do we stop looking for the sequence after it finishes the first time?

@LuisMendo it must repeat, the fourth test-case covers that.

@redstarcoder Thanks. You should include that in the challenge. Rules should not need to be inferred from the examples

@LuisMendo, hopefully fixed :)

05AB1E, 16 bytes
Thanks to Emigna for saving a byte and fixing a bug!
vyÐl'ŒÎ¾èQi¼ëš}?

Explanation:
vy                # For each character in the string...
  Ð               #   Triplicate that character
   l              #   Convert to lowercase
    'ŒÎ           #   Compressed version of "christmas"
       ¾          #   Push the counting variable (let's call this N)
        è         #   Get the nth character of "christmas", with modular indexing
         Qi   }   #   If equal...
           ¼      #      N += 1
            ë     #   Else...
             š    #      Swapcase
               ?  #   Print that character

Uses the CP-1252 encoding. Try it online!

Does this work with newlines?

@redstarcoder Oops, it didn't. It's fixed now.

This looks just like tinsel. :D

Writing your own language to win? I applaud you sir.

The output isn't correct (try for example Christmas as input), but if you remove u it should work.

@Emigna Ah, I have misunderstood the challenge. Thanks for the heads up!

"""i CAN HArdLY WORK LIKE THIS
please GET ME A NEW KEYBOARD FOR cHRISTMAS"""
the r in "hardly" didn't change

@user3564421: the r in hardly shouldn't change as it is a part of the Christmas bug

@Izzy 05ab1e has existed for a long, long time.

V, 38, 36 bytes
ÄVumaOchristmasòÉf2x`a@"maj~HòHdjV~

Try it online! (contains input and expected output for comparison)
When I first saw this, I thought it would be extremely easy. In fact, if it were not for the "christmas" bug, this would just be 2 bytes: V~. The christmas bug makes it significantly harder, for a very hacky answer.
As usual, here is a hexdump:
00000000: c456 756d 614f 6368 7269 7374 6d61 731b  .VumaOchristmas.
00000010: f2c9 6632 7860 6140 226d 616a 7e48 f248  ..f2x`a@"maj~H.H
00000020: 646a 567e                                djV~

I would love to know more about V.

@ckjbgames Cool, I'd be happy to answer any questions you have! You can always ping me in the vim-golf room. Right now I'm working on making V a little bit easier to learn/creating a tutorial.

PHP, 113 110 102 bytes
while($o=ord($c=$argv[1][$i++]))echo chr(32|$o==ord(christmas[$k%9])?$o|0&$k++:ctype_alpha($c)*32^$o);

takes input from first command line argument. Run with -r.
breakdown

while($o=ord($c=$argv[1][$i++]))// loop through string characters
    echo chr(
        32|$o==ord(christmas[$k%9]) // if $c equals next character in "christmas"
            ?$o|0&$k++              // no change, increase "christmas" index
            :ctype_alpha($c)        // else if $c is a letter
                    *32^$o          // toggle bit 5 of the ascii code
        );

JavaScript, 122 118 114 107 104 93 bytes

f=
s=>s.replace(/./g,c=>(k=c.toLowerCase())=='christmas'[i%9]?++i&&c:k!=c?k:c.toUpperCase(),i=0)

F=s=>console.log(f(s))
F(`Hello World!`)
F(`I like pie :)`)
F(`hELP my KeYboarD
       iS BROKEN`)
F(`cHRISTMAS IS COMING REALLY SOON!`)
F(`C is the first letter in cHRISTMAS`)

11 bytes off thanks @Neil.

Can't you use k!=c?k:c.toUpperCase() to save you a few bytes?

Pyke, 31 25 bytes
FD.dґ~o@Dl3+{DIoK)R!Il3

Try it here!

Does this work with newlines?

@redstarcoder if you escape them as \n and surround the input in " then yes

Perl 6, 84 bytes
{my $i=0;[~] (.lc~~"christmas".comb[$i%9]??(++$i&&$_)!!.ord>90??.uc!!.lc for .comb)}

MATL, 36 30 bytes
"@tk'schristma'H)=?HQXHx}Yo]&h

Strings with newlines need to be defined by concatenating with the ASCII code 10 (see example in the link with the test cases).
Try it online! Or verify all test cases.
Explanation
"              % Implicit input of a string. For each character in that string
  @            %   Push current character
  tk           %   Duplicate and convert to lowercase
  'schristma'  %   Push string. This is 'Christmas' in lowercase and circularly
               %   shifted such that the 'c' is in the second position
  H            %   Push contents of clipboard H, which is initiallized to 2.
               %   This value will be gradually increased when a new character
               %   from the the sequence is found
  )            %   Get character from 'schristma' at that (modular) position
  =            %   Are they equal?
  ?            %   If so
    HQ         %     Push contents of clipboard H and add 1
    XHx        %     Copy into clipboard K and delete
  }            %   Else
    Yo         %     Change case
  ]            %   End
  &h           %   Concatenate stack contents horizontally. This gives a string
               %   with all characters processed up to now
               % Implicit end. Implicit display

C# 197 bytes
Not going to win with this, but hopefully the smallest C# implementation that works...
string C(string s){int i=0,j=0;var r="";for(;i<s.Length;){char c=s[i++],o=(char)32;if(c=="christmas"[j]|c=="CHRISTMAS"[j])j=j>7?0:j+1;else if(c>64&c<91)c+=o;else if(c>96&c<123)c-=o;r+=c;}return r;}

Explanation:
string C(string s)
{
    // define our two index ints
    // i for indexing across the input string
    // j for indexing across christmas
    int i = 0, j = 0;

    // r is our return string
    var r = "";

    // declare our loop
    // skip the initialisation and afterthought
    for (; i < s.Length;)
    {
        // get our current character c, and increment index i
        // initial our offset char o (difference between upper and lower case)
        char c = s[i++], o = (char)32;

        // check if c is the current character in our christmas bug
        if (c == "christmas"[j] | c == "CHRISTMAS"[j])
            // increment j (or reset to 0)
            j = j > 7 ? 0 : j + 1;

        // else if c is an upper case char
        else if (c > 64 & c < 91)
            // add our offset to make it lower case
            c += o;

        // else if c is lower case
        else if (c > 96 & c < 123)
            // subtract our offset to make it upper case
            c -= o;

        // append c to our return string r
        r += c;
    }

    return r;
}

Perl 6, 80 bytes
{my$i=0;S:g{.?<!{'christmas'.comb[$i%9]eq$/.lc&&++$i}>}=$/eq$/.lc??$/.uc!!$/.lc}

Try it
{   # bare block lambda with implicit parameter ｢$_｣

  my $i = 0;             # counter

  S                      # substitute and return ( implicitly against ｢$_｣ )
  :global
  {
    .                    # any char
    ?                    # work around a bug where ｢$/｣ doesn't get set

    <!{                  # fail this match if this block returns True
      'christmas'.comb\  # a list of the characters of ｢christmas｣
      [ $i % 9 ]         # grab a char from the list
      eq                 # is it equal to
      $/.lc              # the lowercase version of the char
      &&                 # if so
      ++$i               # increment ｢$i｣ ( result is True )
    }>

  }

  =                      # for each matched char

  $/ eq $/.lc            # is it lowercase?
  ?? $/.uc               # the uppercase it
  !! $/.lc               # otherwise lowercase it
}

I don't believe omitting the space in my $i=0; is legal. And I wouldn't be surprised if there were more whitespace-related syntax errors.

@bb94 I literally included a link in to a site that will run the code. If you don't believe that will run, why don't you try it. I mean I wrote $/ eq $/.lc rather than $/.lc eq $/ so that I could remove the space before eq.

@bb94 I can confirm it working on the linked compiler.

Ruby, 63+1 = 64 bytes
Uses the -p flag.
i=0;gsub(/./){|c|c=~/#{"christmas"[i%9]}/i?(i+=1;c):c.swapcase}

Java 7, 200 bytes
String c(char[]a){String r="";int i=0,s;Character l='a';for(char c:a)if((s="christma".indexOf(l=l.toLowerCase(c)))==i|i>7&s==4){r+=c;i=i>7?0:i+1;}else r+=l.isUpperCase(c)?l:l.toUpperCase(c);return r;}

Ugly, but it works.. Can definitely without any doubt be golfed more.. I'm rusty..
Ungolfed:
String c(char[] a){
  String r = "";
  int i = 0,
      s;
  Character l = 'a';
  for(char c : a){
    if((s = "christma".indexOf(l = l.toLowerCase(c))) == i) | i > 7 & s == 4){
      r += c;
      i = i > 7
           ? 0
           : i+1;
    } else{
      r += l.isUpperCase(c)
       ? l
       : l.toUpperCase(c);
    }
  }
  return r;
}

Test code:
Try it here.
class M{
  static String c(char[]a){String r="";int i=0,s;Character l='a';for(char c:a)if((s="christma".indexOf(l=l.toLowerCase(c)))==i|i>7&s==4){r+=c;i=i>7?0:i+1;}else r+=l.isUpperCase(c)?l:l.toUpperCase(c);return r;}

  public static void main(String[] a){
    System.out.println(c("i CAN HARDLY WORK LIKE THIS please GET ME A NEW KEYBOARD FOR cHRISTMAS".toCharArray()));
    System.out.println(c("Hello World!".toCharArray()));
    System.out.println(c("I like pie :)".toCharArray()));
    System.out.println(c("hELP my KeYboarD\niS BROKEN".toCharArray()));
    System.out.println(c("cHRISTMAS IS COMING REALLY SOON!".toCharArray()));
    System.out.println(c("C is the first letter in cHRISTMAS".toCharArray()));
  }
}

Output:
I Can HaRdly work lIke thiS PLEASE geT Me A new keyboard for ChriStmas
hELLO wORLD!
i LIKE PIE :)
Help MY kEyBOARd
Is broken
cHRISTMAS is Coming really soon!
C IS ThE FIrST LETTER iN ChriSTMAS

Java 's beating Haskell and C#!

Python 100 bytes
def a(s,i=0,g=''):
 for c in s:a=c.lower()=='christmas'[i%9];i+=a;g+=[c.swapcase(),c][a]
 return g

C# 239 chars
var s=Console.ReadLine().ToCharArray();int j=0,i=0;var c="christmas";for(;j<s.Length;j++)if(s[j]==c[i%9]|s[j]==(c[i%9]-32))i++;else if(s[j]>64&s[j]<91)s[j]=(char)(s[j]+32);else if(s[j]>96&s[j]<123)s[j]=(char)(s[j]-32);Console.WriteLine(s);

more explicit version:
var s = Console.ReadLine().ToCharArray();
int j = 0,i = 0;
var c = "christmas";
for (var j = 0; j < s.Length; j++)
   if (s[j] == c[i%9]|s[j] == (c[i%9] - 32))// non case sensitive compare with c
      i++;//next char in christmas
   else
      if (s[j] > 64 & s[j] < 91)//if between A and Z
         s[j] = (char)(s[j] + 32);//convert to a-z
      else
         if (s[j] > 96 & s[j] < 123)//if between a and z
            s[j] = (char)(s[j] - 32);//convert to A-Z
Console.WriteLine(s);

this is a pretty naïve solution, and probably can be improved (maybe we can allow implicit conversion to char?).
it assumes to be inside a function, reads from the console (stdin), and writes to it (stdout).
edit: Char.IsUpper(s[j]) is 2 bytes longer than s[j]>64&&s[j]<91,  Char.ToUpper is longer than my version too.

Haskell, 222 207 Bytes
import Data.Char
s=(+(-65)).ord
f=(`divMod`32).s
l=[['a'..'z'],['A'..'Z']]
c=cycle$map s"CHRISTMAS"
k _[]=[]
k(a:b)(x:y)|isAlpha x=let(d,m)=f x in if(m==a)then(x:k b y)else(l!!d!!m:k(a:b)y)|1>0=x:k(a:b)y
main=interact$k c

updated:
import Data.Char
s=(+(-65)).ord
k _[]=[]
k(a:b)(x:y)|isAlpha x=let(d,m)=s x`divMod`32 in if(m==a)then(x:k b y)else([['a'..'z'],['A'..'Z']]!!d!!m:k(a:b)y)|1>0=x:k(a:b)y
main=interact$k$cycle$map s"CHRISTMAS"

How it works:

s=(+(-65)).ord

s x = ASCII value of x - ASCII value of 'A'
f=(`divMod`32).s

f (s x) = (0,s x) for uppercase, (1, (s x-32)) for lowercase
l=[['a'..'z'],['A'..'Z']]

parallel list of letters, indexable by f (lowercase->1->uppercase, uppercase->0->lowercase)
c = cycle $ map s "CHRISTMAS"

infinite list of the ascii values of uppercase christmas repeated
k _ []=[]

base case
k (a:b) (x:y) | isAlpha x = let (d,m) =f x
                             in if m == a
                                then x : k b y
                                else (l!!d)!!m : k (a:b) y
              | 1 > 0 = x : k (a:b) y

return non-alphanumeric characters, and either keep the letter if its s-value is the same as the current letter of christmas (going to the next letter), otherwise convert it to the other case and proceed
main=interact$k c

IO

Perl 5 -F, 62 bytes
say map{(christmas=~/./g)[$i%9]ne lc?/[a-z]/?uc:lc:++$i&&$_}@F

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Draw nested radicals
Many formulas in math involve nested radicals (square root signs inside other square roots signs). Your task here is to draw these using ascii art.
Specs
You will be given two integers, the number inside the radical, and the number of radicals. I think the best way to explain what you have to do is with an example. Here is the output for 2, 4:
        ____________________
\      /       _______________
 \    /  \    /     __________
  \  /    \  /  \  /   _____
   \/      \/    \/  \/ 2

Here are some things to note:

The height of each radical increases by one
The length of the _'s are always 5 times the height
There is a space after the last / and before the next inner radical starts
The number inside will never be greater than 4 digits
If the number of radicals is 0, just output the number
Putting extra spaces to pad it into a rectangle is up to you
This is code-golf, so shortest code in bytes wins!

Test Cases
2, 4:
        ____________________
\      /       _______________
 \    /  \    /     __________
  \  /    \  /  \  /   _____
   \/      \/    \/  \/ 2

23, 0:
23

4, 1:
  _____
\/ 4

1234, 3:
      _______________
\    /     __________
 \  /  \  /   _____
  \/    \/  \/ 1234

I feel like this would be a slightly better challenge if the horizontal bars all had to end at the same point.

Python 3.5, 145 137 bytes
def s(n,x):[([print(' '*j+'\\'+'  '*i+'/ '+' '*j,end='')for j in range(x-i-1,-1,-1)],print('  '*i+i*'_____'or n))for i in range(x,-1,-1)]

Slightly ungolfed:
def s(n,x):
    for i in range(x,-1,-1):
        for j in range(x-i-1,-1,-1):
            print(' '*j+'\\'+'  '*i+'/ '+' '*j,end='')
        print('  '*i+i*'_____' or n)

Output:
s(2,4)
        ____________________
\      /       _______________
 \    /  \    /     __________
  \  /    \  /  \  /   _____
   \/      \/    \/  \/ 2

print('  '*i+'_____'*i or n) saves 7 bytes. EDIT print('  '*i+i*'_____'or n) saves 8.

Thank you. I did not know you could use 'or' like that.

JavaScript, 133 132 131 bytes

f=(n,r,q=r)=>~r?'1\\0/1 '[x='repeat'](d=q-r).replace(/\d/g,i=>' '[x](+i?d-=.5:r*2))+(r?' '[x](r*2)+'_'[x](5*r):n)+`
`+f(n,r-1,q):''

F=(n,r)=>console.log( f(n,r) )
F(2,4)
F(23,0)
F(4,1)
F(1234,3)
.as-console-wrapper{max-height:100%!important;top:0}

JavaScript (ES6), 124 bytes

f=(s,n,i=0,r=(n,c=` `)=>c.repeat(n))=>n?r(n+n)+r(n*5,`_`)+`
`+f(s,n-1).replace(/^/gm,_=>r(i)+`\\${r(n+~i<<1)}/`+r(++i)):s+``

<input id=s><input id=n type=number min=0>

Save 3 bytes if the first parameter can be a string rather than a number.

PHP, 178 bytes
for($r=[" $argv[1]"];$i++<$argv[2];$r[]=$p("",2*$i).$p(_,5*$i,_))for($k=-1;++$k<$i;)$r[$k]=($p=str_pad)("\\".$p("",2*$k)."/",2*$i," ",2).$r[$k];echo join("\n",array_reverse($r));

bah that´s awfully long.