text:
Visualize chain rule
Definition
The chain rule with two functions state that:
D[f(g(x))] = f'(g(x)) * g'(x)

Or, alternatively:
D[f1(f2(x))] = f1'(f2(x)) * f2'(x)

The chain rule with three functions state that:
D[f(g(h(x)))] = f'(g(h(x))) * g'(h(x)) * h'(x)

Or, alternatively:
D[f1(f2(f3(x)))] = f1'(f2(f3(x))) * f2'(f3(x)) * f3'(x)

Et cetera.
Task

Given an integer between 2 and 21, output the chain rule with that many functions, either in the first form or in the second form.
Please specify if you are using the second form.

Specs

The format of the string must be exactly that stated above, with:

all the spaces kept intact
a capitalized D
a square bracket immediately following D
the asterisk kept intact

One extra trailing space (U+0020) is allowed.
Leading zeros in the function names in the second form (e.g. f01 instead of f1) is allowed.

Testcases
If you use the first form:
input output
2     D[f(g(x))] = f'(g(x)) * g'(x)
3     D[f(g(h(x)))] = f'(g(h(x))) * g'(h(x)) * h'(x)

If you use the second form:
input output
2     D[f1(f2(x))] = f1'(f2(x)) * f2'(x)
3     D[f1(f2(f3(x)))] = f1'(f2(f3(x))) * f2'(f3(x)) * f3'(x)

Leaderboard

var QUESTION_ID=86652,OVERRIDE_USER=48934;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Do function names have to be lowercase?

@betseg Yes of course.

Python 2, 79 bytes
f=lambda n:0**n*"D[x] ="or f(n-1).replace("x","f%d(x)"%n)+1%n*" *"+" f%d'(x)"%n

Outputs with numbered functions.
Builds the output by repeatedly replacing each x with fn(x), then appending * fn'(x). The * is omitted for n==1.
Compare to the iterate program (92 bytes):
r="D[x] = ";n=0
exec'n+=1;r=r.replace("x","f%d(x)"%n)+"f%d\'(x) * "%n;'*input()
print r[:-3]

96 bytes:
n=input();r='';s='x'
while n:s='f%d(%%s)'%n%s;r=" * f%d'"%n+s[2:]+r;n-=1
print"D[%s] = "%s+r[3:]

Outputs with numbered functions.
Accumulates the nested function f1(f2(f3(x))) in s and the right-hand-side expression in r. The string formatting is clunky; f-strings from 3.6 would do better.

Sesos, 49 bytes
0000000: 2ac992 63fb92 245fb6 6c57be 255bbe 2cc9bf 6d49da  *..c..$_.lW.%[.,..mI.
0000015: 025e7f fdced0 fd67f8 fcde33 b6a7b2 643d4f 65597e  .^.....g...3...d=OeY~
000002a: f77a72 dd73cf fe                                  .zr.s..

Try it online
Disassembled
set numin
add 68   ; 'D'
put
sub 7    ; '=' - 'D'
fwd 1
add 32   ; ' '
fwd 1
add 91   ; '['
put
add 2    ; ']' - '['
fwd 1
add 102  ; 'f'
fwd 1
add 40   ; '('
fwd 3
add 120  ; 'x'
rwd 2
get
jmp
    jmp
        fwd 1
        add 1
        rwd 3
        put
        add 1
        fwd 1
        put
        fwd 1
        sub 1
    jnz
    sub 1
    rwd 1
    add 1    ; ')' - '('
    fwd 3
    put
    rwd 1
    jmp
        rwd 3
        sub 1
        fwd 1
        put
        fwd 1
        add 1
        fwd 1
        sub 1
    jnz
    rwd 4
    put
    get
    add 41   ; ')'
    rwd 1
    put
    rwd 1
    put
    get
    add 42   ; '*'
    fwd 1
    put
    fwd 2
    put
    add 1
    fwd 1
    sub 2    ; '\'' - ')'
    put
    add 1    ; '(' - '\''
    put
    fwd 1
jnz
fwd 2
put
rwd 5
put

JavaScript (ES6), 89 bytes
f=n=>--n?f(n).replace(/x/g,`${c=(n+15).toString(36)}(x)`)+` * ${c}'(x)`:`D[f(x)] = f'(x)`

Or 75 bytes using the second form:
f=n=>n>1?f(n-1).replace(/x/g,`f${n}(x)`)+` * f${n}'(x)`:`D[f1(x)] = f1'(x)`

Or 82/64 bytes if I'm allowed an extra 1 * term:
f=n=>n?f(n-1).replace(/x/g,`${c=(n+14).toString(36)}(x)`)+` * ${c}'(x)`:`D[x] = 1`
f=n=>n?f(n-1).replace(/x/g,`f${n}(x)`)+` * f${n}'(x)`:`D[x] = 1`

Why don't you put the 73-byte version as your main?

If you're being recursive, you need the f= or else your program won't work.

@KevinLau-notKenny Bah, I always forget to do that.

Ruby, 72 bytes
Second form. Port to Ruby from @Neil answer.
f=->n{n>1?f[n-1].gsub(?x,"f#{n}(x)")+" * f#{n}'(x)":"D[f1(x)] = f1'(x)"}

Julia, 66 bytes
!x=x>1?replace(!~-x,"x","f$x(x)")*" * f$x'(x)":"D[f1(x)] = f1'(x)"

Port of @Neil's ES6 answer. Uses the second form.

Python 2, 174 bytes
i=input()+1
a=lambda x:'('.join(['f%d'%e for e in range(x,i)])+'(x'+')'*(i-x)
print'D[%s] = %s'%(a(1),' * '.join(["f%d'%s%s)"%(e+1,'('*(i-e-2>0),a(e+2))for e in range(i-1)]))

Lots of room left to be golfed here. Uses the second form (f1, f2, etc.).

JavaScript (ES6), 194 bytes
n=>{s="D[";for(i=1;i<=n;i++)s+="f"+i+"(";s+="x";s+=")".repeat(n);s+="] = ";for(i=1;i<=n;i++){s+="f"+i+"'(";for(j=i+1;j<=n;j++)s+="f"+j+"(";s+="x";s+=")".repeat(n-i+1);if(i-n)s+=" * ";}return s;}

31 bytes saved thanks to @LeakyNun.
It's an anonymous lambda function.
I'm sure there's some way to shorten this...
Ungolfed
var chain = function(n) {
    var str = "D["; // derivative symbol
    for (var i = 1; i <= n; i++) {
        str += "f"+i+"("; // put in n functions, each labeled f1(, f2(, etc.
    }
    str += "x"; // add in the function input, usually "x"
    for (var i = 0; i < n; i++) {
        str += ")"; // add in n end parentheses
    }
    str += "] = "; // add in the end bracket and the equals operator
    for (var i = 1; i <= n; i++) {
        str += "f"+i+"'("; // add in all n of the outer functions with the prime operator
        for (var j = i+1; j <= n; j++) {
            str += "f"+j+"("; // add in all of the inner functions
        }
        str += "x"; // add in the input, "x"
        for (var j = 1; j <= n; j++) {
            str += ")"; // close the parentheses
        }
        if (i !== n) {
            str += " * "; // the multiplication of all of the outer primed functions
        }
    }
    return str;
};

Change str into s.

Ok, I forgot to change it. Lol

Change for(j=i;j<=n;j++)s+=")"; to s+=")".repeat(n-i+1);


text:
Do X without Y
Usually, it is said that "Doing X without Y" can be a trap to beginners writing challenges (source). However, I am cocky and think that I can definitely make an X without any Ys. Randomly. Oh yes, this will be good.
Challenge: Given an odd integer n greater than or equal to 1, output an ex of side length n made of random printable ascii characters sans "y" and "Y", and the space. All allowed characters must have a nonzero chance of occurring, but not necessarily uniform. This is a code-golf so the shortest code in bytes wins. You should, however, randomize each char--that is, the struts of the ex shouldn't be equal, unless if by chance.
The chars to appear
!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXZ[\]^_`abcdefghijklmnopqrstuvwxz{|}~"

Constructing the ex
Side length 1:
x

Side length 3:
x x
 x
x x

Side length 5:
x   x
 x x
  x
 x x
x   x

etc.
Example outputs
input
output
empty line

3
h 2
 ^
9 5

1
:

5
D   1
 W z
  W
 q j
W   1

Example implementation
You do not need to handle invalid inputs.

function generate(sideLength){
    var result = "";
    var INNER = "@"
    for(var i = 0; i < sideLength; i++){
        var p = i < sideLength / 2 ? i : sideLength - i - 1;
        result += " ".repeat(p) + ((sideLength / 2 | 0) == p ? "" : INNER) + " ".repeat(Math.max(sideLength - p * 2 - 2, 0)) + INNER + "\n";
    }

    return result.replace(RegExp(INNER, "g"), function(e){
        let c = "y";
        while(c === "y" || c === "Y"){
            c = String.fromCharCode((Math.random() * 94) + 33 | 0);
        }
        return c;
    });
}

function print(v){
    output.innerHTML = "";
    output.appendChild(document.createTextNode(v));
}

function update(){
    var n = Number(input.value);
    if(n !== Math.floor(n)) print("error: " + n + " is not an integer.");
    else if(n % 2 === 0)    print("error: " + n + " is not odd.");
    else if(n < 1)          print("error: " + n + "is less than one.");
    else                    print(generate(n));
}

input.onchange = update;

update();
* {
  font-family: Consolas, monospace;
}

#output {
  white-space: pre;
}
<input id="input" min=1 value=1 type=Number>

Which characters exactly must be eligible for appearing?

@xnor Characters from ! to ~ sans y and Y

@LegionMammal978 No, because non-Y characters include y and 然.

@CᴏɴᴏʀO'Bʀɪᴇɴ I take it then that other characters not in the list may not appear?

@xnor Yes, you are right.

It is OK if our program tries generating the X repeatedly until it gets one without a y, and then prints it? It is OK if the number of tries is some function of n such that the probability of not getting it is exponentially small?

@xnor Both are acceptable.

Hmm.. random...

Wait!? We're allowed to use "Y" and "y" in the our code?

Pyth, 28 27 26 25 bytes

jmuXGHO-rF"!~""Yy"{,d-tQd*;Q
VQuXGHO-rF"!~""Yy"{,N-tQN*d
VQuXGHO-r\!\~"Yy"{,N-tQN*d
VQuXGHO-r\!\~"Yy",N-tQN*d
VQuXGHO-r\!\[DEL];"Yy",N-tQN*d

Try it online!

Ruby, 102 bytes
Array#sample doesn't do repetitions for sampling from the character set, but that's OK because the character distribution don't have to be perfectly uniform! Recursive function, returns an array of lines.
Try it online!
f=->l{w,x,y,z=([*?!..?~]-%w"y Y").sample 4
l<2?[w]:[w+(s=' '*(l-2))+x,*f[l-2].map{|e|" #{e} "},y+s+z]}

Even without repetition, each character has equal chance to be picked =) It's just that you can't generate output that have repeated characters.

Mathematica, 146 bytes
a:=RandomChoice[33~CharacterRange~126~Complement~{"Y","y"}];StringRiffle[Normal@SparseArray[{{b_, b_}:>a,{b_,c_}/;c-1==#-b:>a},{#,#}," "],"
",""]&

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

Python, 142 139 135 bytes
This is a straight forward implementation create the square character by character. If the character is on a diagonal: use a random char, else: use a space. This also uses a regex substitution and random int to generate non-Y characters:
import re,random
lambda x:''.join('\n'*(i%x<1)+re.sub("y|Y","t",chr(random.randint(33,126))+' ')[i%x!=i/x!=x-i%x-1]for i in range(x*x))

Explanation [ Old ]
"\n".join( ... for i in range(x)) # Create 'x' lines
''.join( ... for j in range(x))   # Create 'x' chars on each line
(...)[j!=i!=x-j-1]                # Not on diagonals? 2nd char in "? "; Else, choose the 1st
j!=i                              # Not on downward diagonal
i!=x-j-1                          # Not on upward diagonal
re.sub("y|Y","t", ... )           # Replace y or Y for t
chr(random.randint(33,126))+' '   # Random char + a space

Update

-4  [16-07-30] Shortened newline conditional
-3  [16-07-30] Changed to single for-loop
-6  [16-07-29] Exchanged if statement for ternary op. Thanks to @RootTwo
-11 [16-07-27] Removed extra brackets/spaces and flipped if statement
-49 [16-07-27] Absorded @squeamishossifrage's method by creating the square step-by-step, Thanks!
-10 [16-07-27] Shorten random char lambda + math stuff from @ConorO'Brien
-22 [16-07-26] Squeaze in a lambda + misc golfing
-6  [16-07-26] import* - Thanks to @KevinLau

randint is probably shorter for your purposes, plus from random import*. Also, remove some of that unnecessary white space.

[i,33][i in(89,121)] works instead needing a long-winded ternary in your f function! Also see if you can remove the space that's right after your print statements

I would suggest trying a different format for your code explanation. This isn't very readable. Try looking at how other users do theirs. Even this would be better.

re.sub("y|Y","t",chr(random.randint(33,126))+' ')[j!=i!=x-j-1] saves 6 bytes over the ... if ... else ... construct.

Actually, 62 bytes
"!⌂"♂┘ix♂c"Yy"@-╗½≈u;r2@∙`i=`M╪k`;dXR@+`M;dXR@+`"╜J' aI"£MΣ`Mi

This is one of the longest Actually programs I've ever written.
Try it online!
Explanation:
Part 1: setting up the character list
"!⌂"♂┘ix♂c"Yy"@-
"!⌂"              push the string "!⌂"
    ♂┘            CP437 ordinal of each character ([21, 127])
      ix          range(21, 127)
        ♂c        character at each ordinal (list of printable ASCII characters)
          "Yy"@-  set difference with ["Y", "y"] (printable ASCII except "Y" and "y")

Try it online!
Part 2: constructing the boolean array for an X
½≈u;r2@∙`i=`M╪k`;dXR@+`M;dXR@+
½≈u;                            two copies of int(input/2)+1
    r                           range
     2@∙                        Cartesian product with itself
        `i=`M                   for each sublist: push 1 if both elements are equal, else 0
             ╪k                 split into int(input/2)+1-length chunks
                                (at this point, we have one quarter of the X)
               `;dXR@+`M        mirror each sublist (one half of the X)
                        ;dXR@+  mirror the entire list (the whole X)

Try it online!
Part 3: picking random characters
`"╜J' aI"£MΣ`Mi
`"╜J' aI"£MΣ`M   for each row:
 "╜J' aI"£M        for each column:
  ╜J                 push a random value from the character list
    '                push a space
      a              invert the stack
       I             take the character if the value is 1, else take the space
           Σ       concatenate the strings
              i  flatten the list and let implicit output take care of the rest

Try it online!

"Visualize bit weaving" was 69 bytes ;-)

Python 2, 171 bytes
from random import*
def x(n):
 w=range(-n/2+1,n/2+1)
 for i in w:
  o=''
  for j in w:c=randint(33,124);c+=(c>88)+(c>119);c=[c,32][bool(i^j and i^-j)];o+=chr(c)
  print o

Guaranteed to choose random characters with uniform probability.
Try it out here: ideone link
EDIT: Thanks to Morgan Thrapp for the corrections.

from random import* saves 2 bytes. You can also join the first two lines of the j loop with a semicolon to save some bytes. (Also I believe Z and  { have a higher chance of occurring than some other letters, not that it matters for the question)

You can get down to 165 with a couple small modifications https://mothereff.in/byte-counter#import%20random%20as%20r%0Adef%20x%28n%29%3A%0A%20w%3Drange%28-n%2Cn%2B1%29%0A%20for%20i%20in%20w%3A%0A%20%20o%3D%27%27%0A%20%20for%20j%20in%20w%3Ac%3Dr.randint%2833%2C124%29%3Bc%2B%3D%28c%3E88%29%2B%28c%3E119%29%3Bc%3D%5Bc%2C32%5D%5Bbool%28i%5Ej%20and%20i%5E-j%29%5D%3Bo%2B%3Dchr%28c%29%0A%20%20print%20o

Actually, your output is wrong for all the test cases. You're making each leg equal to n instead of the total side size.

@MorganThrapp Ah, you're right. I'll fix that

4 bytes: bool(i^j and i^-j) -> i not in(j,-j)

Dyalog APL, 35 bytes
⎕UCS 32+(⊢+∊∘57 89)⌊?95×(⊢∨⌽)∘.=⍨⍳⎕

⎕ prompt for number
⍳ 1 through that number
∘.=⍨ equality table (i.e. the diagonal has 1s)
(⊢∨⌽) itself OR its mirror image (gives both diagonals)
95× multiply by 95
? rand int between 1 and 95 for the diagonals, rand float between 0 and 1 for the rest
⌊ floor to get rid of the floats
(⊢+∊∘57 89) add one to the elements that are a member of {57,89} (Yy – 32)
32+ add 32 to make the 0s into spaces, and other numbers into the proper range
⎕UCS convert to text
TryAPL!

I like how this one also reacts with even numbers, even though that wasn't part of the problem (and might even be unintentional). Good job! Though, oddly, it sometimes treats an input of 4 differently than any other input.

@kirkpatt Yeah, I didn't even notice the "odd-only"..

x86 machine code, 70 bytes
60 89 d7 31 db 43 88 ce b2 fe 49 d1 e1 87 da 0f
c7 f0 24 7f 3c 22 72 f7 48 3c 79 74 f2 3c 59 74
ee aa 49 7c 1c 00 df 79 06 86 f7 42 43 eb f6 f6
c3 01 74 03 b0 0a aa 51 88 f9 b0 20 f3 aa 59 eb
cc c6 07 00 61 c3

My executable code, disassembled:
0000003d <myheh>:
  3d:   60                      pusha
  3e:   89 d7                   mov    %edx,%edi
  40:   31 db                   xor    %ebx,%ebx
  42:   43                      inc    %ebx
  43:   88 ce                   mov    %cl,%dh
  45:   b2 fe                   mov    $0xfe,%dl
  47:   49                      dec    %ecx
  48:   d1 e1                   shl    %ecx

0000004a <myloop>:
  4a:   87 da                   xchg   %ebx,%edx

0000004c <myrand>:
  4c:   0f c7 f0                rdrand %eax
  4f:   24 7f                   and    $0x7f,%al
  51:   3c 22                   cmp    $0x22,%al
  53:   72 f7                   jb     4c <myrand>
  55:   48                      dec    %eax
  56:   3c 79                   cmp    $0x79,%al
  58:   74 f2                   je     4c <myrand>
  5a:   3c 59                   cmp    $0x59,%al
  5c:   74 ee                   je     4c <myrand>
  5e:   aa                      stos   %al,%es:(%edi)
  5f:   49                      dec    %ecx
  60:   7c 1c                   jl     7e <mydone>

00000062 <mylab>:
  62:   00 df                   add    %bl,%bh
  64:   79 06                   jns    6c <myprint>
  66:   86 f7                   xchg   %dh,%bh
  68:   42                      inc    %edx
  69:   43                      inc    %ebx
  6a:   eb f6                   jmp    62 <mylab>

0000006c <myprint>:
  6c:   f6 c3 01                test   $0x1,%bl
  6f:   74 03                   je     74 <myprint1>
  71:   b0 0a                   mov    $0xa,%al
  73:   aa                      stos   %al,%es:(%edi)

00000074 <myprint1>:
  74:   51                      push   %ecx
  75:   88 f9                   mov    %bh,%cl
  77:   b0 20                   mov    $0x20,%al
  79:   f3 aa                   rep stos %al,%es:(%edi)
  7b:   59                      pop    %ecx
  7c:   eb cc                   jmp    4a <myloop>

0000007e <mydone>:
  7e:   c6 07 00                movb   $0x0,(%edi)
  81:   61                      popa
  82:   c3                      ret

It is a function that receives the size of the X in ecx, and a pointer to the output buffer in edx.
It fills the output buffer sequentially with bytes. There are 2 * n - 1 iterations (equal to the number of non-space characters to output). At each iteration, it does the following:

Generate a random number
Fiddle with the number to fit it into range; if it's bad, go back and generate anew
Print the random character
Print a newline (every other iteration)
Print the proper number of spaces

Conversion from a random number to a random character is not remarkable:
myrand:
    rdrand eax;
    and al, 7fh;
    cmp al, 22h;
    jb myrand;
    dec eax;
    cmp al, 'y';
    je myrand;
    cmp al, 'Y';
    je myrand;

The interesting part is the calculation of the number of spaces. It must generate the following numbers (example for N=9):
7    1
5    2
3    3
1    4

     3
1    2
3    1
5    0
7

The numbers are taken alternatingly from two arithmetic progressions. The first one goes down with step -2, and the second one goes up with step 1. When the first progression arrives at -1 (in the middle of the X), there is a glitch (-1 is removed), and then the progressions change direction.
The progressions are stored in registers ebx and edx - the high parts bh and dh store the current number, and the low parts bl and dl store the step. To alternate between the progressions, the code swaps the registers with xchg.
When the progression arrives at -1 (around the mylab label), it increases both registers, switching the steps from -2, 1 to -1, 2. This also changes the roles of the registers, so then it swaps the high parts of the registers.
At the end of the function, it stores a zero byte to indicate an end of string.

Python 2.7, 205 bytes:
from random import*;C=input()/2;S=' ';R=range;Z=lambda:chr(choice(R(33,89)+R(90,121)+R(122,128)));T=lambda*G:''.join([S*i+Z()+S*(2*(~-C-i)+1)+Z()+S*i+'\n'for i in R(*G)]);print T(C)+S*C+Z()+'\n'+T(~-C,-1,-1)

Try It Online! (Ideone)

MATL, 28 bytes
6Y2'Yy 'X-iZr1MZrXdwXdP2$X>c

Try it online!
All the allowed characters have the same probability of appearing. Works for even input too.
6Y2     % Predefined literal of ASCII chars from 32 to 126
'Yy '   % Not allowed chars
X-      % Set difference. Produces the set of allowed chars
i       % Input number, n
Zr      % Random sample without replacement. Gives a string with n chars taken from
        % the allowed set
1MZr    % Do the same
Xd      % Diagonal matrix. Zeros will be displayed as spaces
wXd     % Diagonal matrix with the other string
P       % Flip vertically
2$X>    % Maximum of the two matrices
c       % Convert to char. Implicitly display

C, 154 bytes (or 119 without the boiler-plate)
o(w,c){c=rand()%94+33;printf("%*c",w,w?c+!(c&95^89):10);}main(h){scanf("%d",&h);srand(time(0));for(int n=h,p;n--;)p=abs(h/2-n),o(h/2-p+1),p&&o(p*2),o(0);}

Or 119 bytes as a function X(h) with srand(time(0)) taken care of elsewhere:
o(w,c){c=rand()%94+33;printf("%*c",w,w?c+!(c&95^89):10);}X(h,n,p){for(n=h;n--;)p=abs(h/2-n),o(h/2-p+1),p&&o(p*2),o(0);}

Breakdown:
o(w,c){                         // "Output" function, for all printing
    c=rand()%94+33;             // Generate random char, whether we need it or not
    printf("%*c",               // Print a char with some number of leading spaces
           w,                   // Use "w" (width) - 1 leading spaces
           w?                   // Either print the random char...
             c+!(c&95^89)       // (exclude "y" and "Y" by incrementing to "z"/"Z")
                         :10    // ...or print a newline if called with w = 0
    );
}
main(h){                        // Main function; repurpose argc to store grid size
    scanf("%d",&h);             // Get grid size from stdin
    srand(time(0));             // Boiler-plate for random number seeding
    for(int n=h,p;n--;)         // Loop over all lines (count down to save chars)
        p=abs(h/2-n),           // Calculate half-distance between "X" bars
        o(h/2-p+1),             // Output the first half of the "X" (">")
        p&&                     // If we are not in the centre:
           o(p*2),              //   output the second half of the "X" ("<")
        o(0);                   // Output a newline
}

Japt -R, 25 22 bytes
A much messier approach that somehow worked out shorter than the original. The need for the j1 is annoying me but this is the closest I can get otherwise, without tanking my score (the middle line is wrong).
;Æ2ÆEÅkÕöÃqSp´UaX¹j1Ãû

Try it
;Æ2ÆEÅkÕöÃqSp´UaX¹j1Ãû     :Implicit input of integer U
 Æ                         :Map each X in the range [0,U)
  2Æ                       :  Map the range [0,2)
;   E                      :    ASCII
     Å                     :    Slice off the first character (space)
      k                    :    Case insensitively remove
       Õ                   :      "y"
        ö                  :    Random character
         Ã                 :  End map
          q                :  Join with
           S               :    Space
            p              :    Repeat
             ´U            :      Prefix decrement U
               aX          :      Absolute difference with X
                 ¹         :  End join
                  j1       :  Remove character at 0-based index 1
                    Ã      :End map
                     û     :Centre pad each element with spaces to the length of the longest
                           :Implicit output joined with newlines

Original (w/o flag), 25 bytes
;z ôÈç iÕêÃÔê û ·ry@EÅkÕö

Try it
;z ôÈç iÕêÃÔê û ·ry@EÅkÕö     :Implicit input of integer
 z                            :Floor divide by 2
   ô                          :Range [0,result]
    È                         :Map each X
     ç                        :  X spaces
       i                      :  Prepend
        Õ                     :    "y"
         ê                    :  Palindromise
          Ã                   :End map
           Ô                  :Reverse
            ê                 :Palindromise
              û               :Centre pad each element with spaces to the length of the longest
                ·             :Join with newlines
                 ry           :Replace "y"s
                   @          :  Pass each match through the following function
;                   EÅkÕö     :    As above

JavaScript (ES6), 137 131 125 bytes
n=>[...Array(n)].map((_,i,a)=>String.fromCharCode(...a.map((r=Math.random()*94,j)=>i-j&&i+j+1-n?32:(r+72&95&&r)+33))).join`\n`

Where \n represents the literal newline character. Edit: Saved 1 byte by moving the ' ' inside the String.fromCharCode expression. Saved 5 bytes by making my random character generation non-uniform; the expression r+72&95 is zero for the values that map to Y and y and an ! is generated in their place. Saved 4 bytes when I realised that spreading over String.fromCharCode avoids having to join. Saved 2 bytes by stealing a trick from @edc65.

Lua, 277 Bytes
Well... Lua is sooooo good at manipulating strings :D. First time I had to use local in a statement! I could save some bytes by using Lua 5.1 instead of 5.3 because they moved the global function unpack into the object table at Lua 5.2. But I prefer to stick with the latest version I have :).
Defines a function that should be called with a single parameter (the second one is used for recursion purpose) and returns a string.
function f(n,N)N=N or n e=" "p="\n"r=math.random C=e.char
R={}for i=1,4 do x=r(33,126)R[i]=x~=89 and x~=121 and x or r(33,88)end
local s,S,a,b,c,d=e:rep((N-n)/2),e:rep(n-2),table.unpack(R)return
n<2 and s..C(a)..p or s..C(a)..S..C(b)..s..p..f(n-2,N)..s..C(c)..S..C(d)..s..p
end

Ungolfed
function f(n,N)
  N=N or n                          -- N is equal to the n we had on the first call
  e=" "                             -- shorthand for the space
  p="\n"                            -- shorthand for the newline
  r=math.random                     -- shorthand for math.random
  C=e.char                          -- uses the string e to obtain the function string.char
  R={}                              -- define an array for our random values
  for i=1,4                         -- iterate 4 times (for the random characters)
  do
    x=r(33,126)                     -- random between ASCII "!" and "~"
    R[i]=x~=89 and x~=121           -- if we didn't pick y or Y
           and x                    -- keep this number
         or r(33,88)                -- or roll for a character between "!" and "X"
  end
  local s,S                         -- these variables have to be local
          ,a,b,c,d                  -- or the recursion would change them
         =e:rep((N-n)/2),e:rep(n-2) -- s and S are the number of spaces for the X
           ,table.unpack(R)         -- a,b,c and d are the 4 random characters
  return n<2                        -- if n==1
           and s..C(a)..p           -- we're at the center of the X, time to end recursion
         or                         -- else
           s..C(a)..S..C(b)..s..p   -- concatenate the topmost line for n
           ..f(n-2,N)               -- with the inner X
           ..s..C(c)..S..C(d)..s..p -- and the bottom line
end

PowerShell v2+, 112 bytes
Param($i)function f{Random(33..126-ne121-ne89|%{[char]$_})};1..$i|%{$a=,' '*$i;$a[$_-1]=f;$a[$i-$_]=f;$a-join''}

Reads input off the command line.
For each line, an array of spaces is created, the correct indices filled in with characters pulled from function f, then the char array is joined to output as one line.

You can save 6 bytes by moving the [char] cast outside of Random, and by flipping the -join to be a unary operator --- Param($i)function f{[char](Random(33..126-ne121-ne89))};1..$i|%{$a=,' '*$i;$a[$_-1]=f;$a[$i-$_]=f;-join$a}

Actually, you can save another couple bytes by replacing the function with the PowerShell equivalent of a lambda and use the call-operator & to call it. The following is 103 bytes -- Param($i)$z={[char](Random(33..126-ne121-ne89))};1..$i|%{$a=,' '*$i;$a[$_-1]=&$z;$a[$i-$_]=&$z;-join$a}

Actually, actually ;-), you can save some more by collapsing your -ne, moving the [char] cast to be a [char[]] cast on $a (swapping ' ' for 32 in the process), and moving $z's definition into a parens the first time it's called. Down to 99 (woo! sub-100!) -- Param($i)1..$i|%{$a=,32*$i;$a[$_-1]=&($z={Random(33..126-ne121,89)});$a[$i-$_]=&$z;-join[char[]]$a}

Hah, save another byte by moving $a's definition into a parens the first time it's used. Down to 98 now -- Param($i)1..$i|%{($a=,32*$i)[$_-1]=&($z={Random(33..126-ne121,89)});$a[$i-$_]=&$z;-join[char[]]$a} I think I'll stop here ;-) hehe

Matricks, 79 bytes (non-competing)
Matricks excels as the beginning of making the x and all the random values, but flops when it comes to conditionals...
I marked this as noncompeting because I had to fix a few bugs and get all the new features working after this challenge was posted.
m:n;:1;mr=c:L:L;k({}|{X;})*{m_?33:126;;:L:l;miC<121,89>:gr:c;;:49:gr:c;;:L:l;};

Run with python matricks.py x.txt [[]] <input> --asciiprint
Explanation:
m:n;:1;mr=c:L:L;                   #Initialize matrix to be a square with
                                   #a diagonal of 1s
k...;                              #Set the output to...
({}|{X;})*                         #The boolean x matrix multiplied by...
{m_?33:126;;:L:l;                  #A bunch of random characters
miC<121,89>:gr:c;;:49:gr:c;;:L:l;} #But make sure they are not y or Y

This also supports even numbers.

MATLAB, 86 bytes
a=@(n)(char(changem(randi(92,n),33+[0:55 57:87 89:93],1:92).*(eye(n)|fliplr(eye(n)))))

Some examples:
>> a(1)

ans =

i

>> a(3)

ans =

~ {
 Z
* ^

>>a(5)

ans =

k   E
 | M
  }
 ] s
b   t

>> a(10)

ans =

Q        k
 +      a
  j    w
   X  [
    rO
    %3
   P  d
  K    q
 r      &
?        v

So, a function that changes values in a matrix according to some rules is called changem! Great name!

SmileBASIC, 97 bytes
INPUT S
FOR X=1TO S
FOR Y=1TO S
Q=RND(93)+33?CHR$((Q+!(Q-121&&Q-89))*(X==Y||X+Y==S+1));
NEXT?NEXT

Instead of having to calculate the number of spaces between each character or something, I decided to just print in all locations where X==Y or X+Y==Size+1.
The random character generator just adds 1 if it generates y or Y, so z and Z are slightly more common than usual.

Pip, 33 bytes
32 bytes of code, +1 for -l flag. Strangely enough, the code begins with Y and ends with y...
Ya{$=a|$+a=y-1?RCPARM-`y`s}MMCGy

Takes input as a command-line argument. Try it online!
Explanation
Constructs a grid of the appropriate size; replaces elements on the diagonals with a random non-y character, and all other elements with space.
                                  a is 1st cmdline arg; PA is printable ASCII characters;
                                  s is space (implicit)
Ya                                Yank a into y (global var, accessible within functions)
                             CGy  y by y coordinate grid
  {                       }MM     To each coordinate pair, map this function:
   $=a                             Fold on equality (true if both elements are equal)
      |                            Logical OR
       $+a                         Fold on +
          =y-1                     and test if equal to size - 1
              ?                    If the preceding expression is true, then:
                 PARM               From printable ASCII chars, remove
                     -`y`           regex matching y, case-insensitive
               RC                   Take a random choice from the resulting string
                         s         Else, space
                                  The whole expression returns a nested list, which is
                                  autoprinted as lines of concatenated items (-l flag)

Zsh, 115 122 130 bytes
for i ({1..$1}){for j ({1..$1}){x=$[(i==j)|(j+i==$1+1)?RANDOM%93+33:32]
echo -n ${${(#)x==45?89:x}/[yY]/\-}};echo}

i & j iterate over the rows & columns.
If we're on the X, set x to to a random ascii-value in the valid range, otherwise 32 [space].
Convert ascii-value to text. Switch "-" character (45) to a "Y" (89) if found (necessary to avoid a bug). Change "y" or "Y" to hyphen char "-",  and print

try it online!

122 bytes
130 bytes

We don't allow the input to be assigned to a predefined variable.

Fixed. But the challenge states "given an odd integer n..."

Vyxal 2.6, 22 bytes
½⌈:ʁ\%꘍↲∞v∞⁋?dkP‛yYFƈ%

Try it Online!
½⌈:                    # Push ⌈x/2⌉ twice
   ʁ                   # For each 0...^-1
    \%꘍                # Prepend that many spaces to a %
½⌈     ↲               # Pad to length ⌈x/2⌉ with spaces
        ∞v∞            # Quad palindromise
           ⁋           # Join by newlines
                    ƈ  # Choose...
            ?d         # Input * 2
                    ƈ  # Random items from...
              kP       # Printable ASCII
                ‛yYF   # Without Y
                     % # Replace % in the first bit with the random chars

JavaScript (ES6), 128 131
Edit 3 bytes saved thx @Neil
So bulky, probably not the best approach. Bonus - it works with odd or even input.
n=>[...Array(n)].map((_,i,z)=>String.fromCharCode(...z.map((r=1+Math.random()*94,j)=>32+(j==i|j==n+~i&&(r+7&31?r:25))))).join`
`

F=n=>[...Array(n)].map((_,i,z)=>String.fromCharCode(...z.map((r=1+Math.random()*94,j)=>32+(j==i|j==n+~i&&(r+7&31?r:25))))).join`\n`

Z=_=>{
    o=F(+S.value),O.textContent=o,/y/i.test(o)||setTimeout(Z,100)
}
setTimeout(Z,100)
<input id=S value=15 type=number>

I think r+7&31 gives the same result as (r&31)-25.

@Neil sounds good, thanks

I like how this illustrates the fact that it is random! +1

php, 135 bytes
<?php for(;$i<$n=$argv[1];){$s=str_pad('',$n);$s[$i?:0]=chr(rand(33,126));$s[$n-++$i]=chr(rand(33,126));echo str_ireplace(Y,X,"$s
");}

Fairly straightforward approach uses str_pad to make a string of spaces of the required length, replaces the necessary characters with random ones then replaces any Ys (case insensitive) with Xs and echos the line.Generates 2n+3 notices but, as usual, that's fine.

Emacs Lisp, 269 bytes
(defalias'n'number-sequence)(set'c(mapcar'string(delq 89(delq 121(n 33 126)))))(defun c()(nth(random(length c))c))(defun s(x)" ")(defun x(l)(let((s(mapcar's(n 1 l))))(dotimes(i l)(set'x(copy-seq s))(setf(nth i x)(c)(nth(-(length x)i 1)x)(c))(message(apply'concat x)))))

Ungolfed and slightly modified:
(defvar c (mapcar 'string (delq 89 (delq 121 (number-sequence 33 126)))))
(defun c() (nth (random (length c)) c))
(defun s(x)" ")
(defun x(l)
  (let ((s(mapcar's(n 1 l)))
        x)
    (dotimes (i l)
      (set 'x (copy-seq s))
      (setf (nth i x) (c)
            (nth (- (length x) i 1) x) (c))
      (message (apply 'concat x)))))

Python 2, 204 191 183 bytes
Okay, Python competition here is getting fierce. Here's my attempt on shaving as many bytes as possible. By now I'm stuck (Ok, stuck again).
Credits to @NonlinearFruit for the way random characters are selected.
183 byte version:
import re,random
s=i=input();t=lambda:re.sub("y|Y","t",chr(random.randint(33,126)))
while i>-s:i-=2;u=abs(i);z=(s-u)/2-1;print('',' '*-~z+t()+'\n')[-1==i]+(' '*z+t()+' '*u+t())*(i>-s)

Try It Online! (Ideone)
Main change is to rewrite the conditional
(" "*(z+1)+t()+"\n"if -1==i else"")

as
(""," "*-~z+t()+'\n')[-1==i]

which saves 7 bytes.
191 byte version:
import re,random
s=i=input();t=lambda:re.sub("y|Y","t",chr(random.randint(33,126)))
while i>-s:
 i-=2;u=abs(i);z=(s-u)/2-1;print(' '*(z+1)+t()+'\n'if -1==i else'')+(' '*z+t()+' '*u+t())*(i>-s)

Try It Online! (Ideone)
Main changes are the way random characters are selected and some code rearrangement such as s=input();i=s; becoming s=i=input();, removing the r=range assignment as it is no longer needed and calling abs directly as it results in less bytes of code.
Beating the previous shortest answer in Python by 1 byte! @R. Kap 's approach is used for generating the random characters.
Each iteration of the while loop a row of the ex is printed.
204 byte version:
from random import*
s=input();i=s;a=abs;r=range;t=lambda:chr(choice(r(33,89)+r(90,121)+r(122,128)))
while i>-s:
 i-=2;z=(s-a(i))/2-1;print(' '*(z+1)+t()+'\n'if -1==i else'')+(' '*z+t()+' '*a(i)+t())*(i>-s)

Try It Online! (Ideone)
Ungolfed version to get an idea of how it works:
from random import *
random_character = lambda : chr(choice(range(33,89)+range(90,121)+range(122,128)))

size = input()
current_row = size

while current_row > -size:
    current_row-=2
    n_leading_spaces = (size-abs(current_row)/2)-1
    row_to_print = ''
    if current_row == -1:
        row_to_print = ' ' * (n_leading_spaces+1) + random_chr() + '\n'
    if current_row > -size:
        row_to_print += ' ' * n_leading_spaces + random_chr()+' '*abs(current_row)+random_chr()
    print row_to_print

It was hard to handle the 1-character case!

C, 268 bytes
V(c){for(c=89;c==89||c==121;c=rand()%95+33);return c;}p(n,s){n^1?s-n?printf("%*.c",s-n,32):0,printf("%c%*.c%c\n",V(),n*2-3,32,V()),p(n-1,s),s-n?printf("%*.c",s-n,32):0,printf("%c%*.c%c\n",V(),2*n-3,32,V()):printf("%*.c%c\n",s-n,32,V());}f(n){srand(time(NULL));p(n,n);}

Call f() with the size of the x to draw.

You have to call srand inside your functions, they cannot rely on global state. You can, however, achieve a much shorter program with two nested loops and using the backspace character. A general solution might look like this, but I think a windows specific variant using clock would be valid.

Can you lease add the version of your compiler? on gcc version 4.8.1 for Windows and gcc version 5.3.0 for Cygwin it doesn't works... (on IdeOne Works )

I know it works with GCC 6.1.0, but it should at least work with >4.9. It also works with clang 3.8.1. What errors do you see?

PHP, 100 bytes
for(;($x%=$n=$argv[1])?:$y++<$n&print"\n";)echo strtr(chr($y+$x++-$n&&$x-$y?32:rand(33,126)),yY,zZ);

takes input from command line argument; run with -nr.
combined loop prints characters depending on position
breakdown
for(;
    ($x%=$n=$argv[1])       // inner loop
        ?
        :$y++<$n&print"\n"  // outer loop; print newline
;)
    echo strtr(chr(             // 2. replace Y with Z; print
        $y+$x++-$n&&$x-$y       // 1: if position is not on diagonals
            ?32                 // then space
            :rand(33,126)       // else random printable
    ),yY,zZ);

Vyxal mM, 34 bytes
‹½ƛ\%꘍⁰↲øm;øm⁋?‹4*›ƛ‛yY95ɾ31+CF℅;%

Try it Online!
‹½ƛ       ;                        # Map 0...(n-1)/2...
   \%꘍                             # That many spaces before a %
      ⁰↲                           # Left-padded to correct width
        øm                         # Palindromise
           øm                      # Palindromise
             ⁋                     # Join by newlines
              ?‹4*›                # 4(n-1)+1
                   ƛ            ;  # Map 0...n...
                       95ɾ31+C     # Printable ASCII
                    ‛yY            # Push ys
                              F    # Remove ys
                               ℅   # Choose a random element from this
                                 % # Format the cross by this

source: Stack Exchange

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

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

sort: votes


text:
Sort a number's divisors by prime factorization
Given an input of an integer \$n ≥ 2\$, output a list of its divisors sorted by the
exponents in their prime factorizations, in ascending order, ordering first by
the largest prime, then by the second largest, and so on.
As an example, take the integer \$72\$, which is \$2^3\cdot3^2\$. It has
the divisors
1     3^0 · 2^0
2     3^0 · 2^1
3     3^1 · 2^0
4     3^0 · 2^2
6     3^1 · 2^1
8     3^0 · 2^3
9     3^2 · 2^0
12    3^1 · 2^2
18    3^2 · 2^1
24    3^1 · 2^3
36    3^2 · 2^2
72    3^2 · 2^3

When sorted in ascending order by the exponents on the prime factors, with
larger primes taking priority, this becomes
1     3^0 · 2^0
2     3^0 · 2^1
4     3^0 · 2^2
8     3^0 · 2^3
3     3^1 · 2^0
6     3^1 · 2^1
12    3^1 · 2^2
24    3^1 · 2^3
9     3^2 · 2^0
18    3^2 · 2^1
36    3^2 · 2^2
72    3^2 · 2^3

Note that the list is sorted first by the order of the exponent of 3, and then
by the exponent of 2. You can also think of this as reading from left to right
and top to bottom across the following grid:
        2^0  2^1  2^2  2^3

3^0     1    2    4    8
3^1     3    6    12   24
3^2     9    18   36   72

Test cases:
2 => 1 2
72 => 1 2 4 8 3 6 12 24 9 18 36 72
101 => 1 101
360 => 1 2 4 8 3 6 12 24 9 18 36 72 5 10 20 40 15 30 60 120 45 90 180 360
3780 => 1 2 4 3 6 12 9 18 36 27 54 108 5 10 20 15 30 60 45 90 180 135 270 540 7 14 28 21 42 84 63 126 252 189 378 756 35 70 140 105 210 420 315 630 1260 945 1890 3780
30030 => 1 2 3 6 5 10 15 30 7 14 21 42 35 70 105 210 11 22 33 66 55 110 165 330 77 154 231 462 385 770 1155 2310 13 26 39 78 65 130 195 390 91 182 273 546 455 910 1365 2730 143 286 429 858 715 1430 2145 4290 1001 2002 3003 6006 5005 10010 15015 30030
65536 => 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536
74088 => 1 2 4 8 3 6 12 24 9 18 36 72 27 54 108 216 7 14 28 56 21 42 84 168 63 126 252 504 189 378 756 1512 49 98 196 392 147 294 588 1176 441 882 1764 3528 1323 2646 5292 10584 343 686 1372 2744 1029 2058 4116 8232 3087 6174 12348 24696 9261 18522 37044 74088

Since this is code-golf, the shortest code in bytes wins.

05AB1E, 6 bytes
Code:
ÑÒí{€P

Explanation:
Ñ       # Get the divisors of input.
 Ò      # Factorize each.
  í     # Reverse each.
   {    # Sort the array.
    €P  # Product each.

Uses the CP-1252 encoding. Try it online!.

Noice:p (well done)

Jelly, 8 7 bytes
ÆDÆfU$Þ

Try it online! Thanks to @Dennis for -1 byte.
ÆD         Array of divisors, e.g. 24 -> [1, 2, 4, 8, 3, 6, 12, 24]
      Þ    Sort by...
     $       Combine previous two links...
  Æf           Factorise each, e.g. ['', [2], [3], [2, 2], [2, 3], [2, 2, 2],
                   [2, 2, 3], [2, 2, 2, 3]]
    U          Upend/reverse each sublist

ÆDÆfU$Þ (using Jelly's new sort-by), saves a byte.

Jelly, 12 10 bytes
2 bytes thanks to @Sp3000.

ÆE‘ḶUṚŒpUṚÆẸ
ÆEU‘ḶŒpUÆẸ

Try it online!
Test suite.
ÆE            Array of exponents, e.g. 24 -> [3, 1] since 24 = 2^3*3^1
  U           Upend/reverse, e.g. [1, 3]
   ‘Ḷ         Range of each, from 0, e.g. [[0, 1], [0, 1, 2, 3]]
     Œp       Cartesian product, e.g. [[0, 0], [0, 1], ..., [1, 3]]
       U      Upend, reversing the innermost lists
        ÆẸ    Inverse of ÆE, converting exponents back into a number

Credits to @Sp3000 for coming up with the format of the explanation.

Pyth, 10 bytes
+1{*Mt_DyP

Try it online: Demonstration
Sadly the product over an empty list is not defined as 1 in Pyth. This costs three extra bytes.
Explanation:
+1{*Mt_DyPQ   implicit Q (=input number) at the end
         PQ   prime factorization of input
        y     powerset
      _D      order by reversed subsets
     t        remove the empy subset
   *M         compute the product of each subsets
  {           remove duplicates
+1            prepend 1

Python 2, 85 bytes
n=input()
p,=L=[1]
while~-n:
 l=L;p+=1
 while n%p<1:L=l+[x*p for x in L];n/=p
print L

No factorization, no sorting. Same-length recursive implementation:
f=lambda n,p=2:1/n*[1]or n%p and f(n,p+1)or[x*c for x in f(n/p)for c in[1,p][x%p<1:]]

Actually, 19 bytes
;÷#o♂w♂RS`"iⁿ"£Mπ`M

Try it online!
Explanation:
;÷#o♂w♂RS`"iⁿ"£Mπ`M
;                    duplicate input
 ÷                   divisors
  #o                 include input in divisors list (note to self: fix this bug)
    ♂w               factor each integer into a list of [prime, exponent] pairs
      ♂R             reverse each list, so that the largest prime comes first
        S            sort the list
         `"iⁿ"£Mπ`M  for each factorization:
          "iⁿ"£M       for each [prime, exponent] pair:
           iⁿ            push prime**exponent
                π      product

JavaScript, 78 bytes
f=(n,p=2,a=[1],b=a)=>n<2?a:n%p?f(n,p+1,a):f(n/p,p,a.concat(b=b.map(m=>m*p)),b)

Based on @xnor's idea, although I didn't understand his code so I had to reimplement it from scratch. The basic algorithm is that you start with [1] and multiply by [1,...,pᵏ] for each pᵏ in the prime factorisation of n, although as I don't have prime factorisation or cartesian product I have to do it all recursively. Example:
n=72 p=2 a=[1] b=[1]
n=36 p=2 a=[1,2] b=[2]
n=18 p=2 a=[1,2,4] b=[4]
 n=9 p=2 a=[1,2,4,8] b=[8]
 n=9 p=3 a=[1,2,4,8] b=[1,2,4,8]
 n=3 p=3 a=[1,2,4,8,3,6,12,24] b=[3,6,12,24]
 n=1 p=3 a=[1,2,4,8,3,6,12,24,9,18,36,72] b=[9,18,36,72]

Just remembered when you were at 10k.. now almost at 14k. Keep it up!!

R, 196 bytes
n=scan()
if(n<4)c(1,n)else{
r=2:n
d=NULL
while(n>1){i=r[min(which(n%%r==0))];d=c(d,i);n=n/i}
m=unique(d)
b=table(d)
l=list()
for(i in 1:length(m))l[[i]]=m[i]^(0:b[i])
apply(expand.grid(l),1,prod)}

This is going to be inefficient as heck because I hardly resisted the temptation of using library(primes). It creates a vector d of all prime factors of the input, computes their frequency (number of occurreces),  and then computes the cartesian product of all possible powers (from 0 to the respective frequency b[i]), to which the prod function is applied. Dang it, special cases of 2 and 3! Otherwise, this is a nice showcase of R dataframe handling and vector functions / by-row operations (and even the purely statistical table function!).
Of course, its efficiency can be improved at the cost of 15 bytes using r=2:ceiling(sqrt(n)), if someone cares. Here is a nicer ungolfed version:
factorise <- function(n){
  if (n<4) c(1,n) else { # Now that all special cases have been handled
    r=2:ceiling(sqrt(n)) # We check all divisors smaller than the square root
    d=NULL # Initiate the variable for divisors
    while (n>1) {
      i=r[min(which(n%%r==0))] # Check the first divisor with a zero remainder
      d=c(d,i) # Append it to the list of divisors
      n=n/i   # Divide by it and check again
    }
    m=unique(d) # Get unique divisors, and they are already sorted
    b=table(d) # Count their frequencies
    l=list() # Initiate a list of all possible powers of unique factors
    for(i in 1:length(m)) l[[i]]=m[i]^(0:b[i]) # Calculate powers
    apply(expand.grid(l),1,prod) # Make a cartesian dataframe and row-multiply
  }
}

Mathematica 150 bytes
f[t_]:=Thread@{#,IntegerExponent[t,#]&/@#}&@Prime@Range@PrimePi@Max@FactorInteger[t][[All,1]];Times@@@(#^#2&@@@#&/@Sort[Reverse/@(f@#&/@Divisors@#)])&

Brachylog, 3 bytes
fḋᵒ

Try it online!
The code reads more or less just as the title of the challenge: "the factors of the input, sorted by their prime decompositions". Making sure that this 3-byte beauty actually passed the test cases using only Brachylog's built-in sense of how to sort lists ended up requiring me to copy and paste all those many numbers into the Clojure REPL, where list elements are separated by whitespace and commas are whitespace, but it turned out that it does indeed work.

APL (Dyalog Extended), 17 bytes
Many thanks to ngn and Adám for their help in golfing both of these APL programs in The APL Orchard, a great place to learn APL and get APL help.
∊×⍀/⌽{⊂×\1,⍵}⌸⍨⍭⎕

Try it online!
Ungolfing
∊×⍀/⌽{⊂×\1,⍵}⌸⍨⍭⎕

                ⎕  Gets evaluated input from stdin.
               ⍭   Gives us a list of the prime factors of our input.
                   Example for 720: 2 2 2 2 3 3 5
     {      }⌸⍨    ⌸ groups our prime factors by the keys in the left argument,
                   and ⍨ passes the prime factors as both arguments,
                   grouping all the identical primes together
                   before running a {} dfn on them
      ⊂×\1,⍵       We append 1 to each group, get a list of powers of each prime,
                   and enclose the groups to remove 0s from uneven rows.
    ⌽             This reverses the prime power groups.
 ×⍀/              This multiplies all the powers together into
                   a matrix of the divisors of our input.
                   (Same as ∘.×/ in Dyalog Unicode)
∊                  And this turns the matrix into
                   a list of divisors sorted by prime factorization.
                   We print implicitly, and we're done.

APL (Dyalog Unicode), 29 bytesSBCS
{∊∘.×/⌽{⊂×\1,⍵}⌸⍨¯2÷/∪∧\⍵∨⍳⍵}

Try it online!
Ungolfing
{∊∘.×/⌽{⊂×\1,⍵}⌸⍨¯2÷/∪∧\⍵∨⍳⍵}

{                           }  A dfn, a function in brackets.
                        ⍵∨⍳⍵   We take the GCD of our input with
                               all the numbers in range(1, input).
                     ∪∧\       This returns all the unique LCMs of
                               every prefix of our list of GCDs.
                               Example for 72: 1 2 6 12 24 72.
                 ¯2÷/          We divide pairwise (and in reverse)
                               by using a filter window of negative two (¯2).
                               Example for 72: 2 3 2 2 3, our prime factors.
       {      }⌸⍨              ⌸ groups our prime factors by the keys in the left argument,
                               and ⍨ passes the prime factors as both arguments,
                               grouping all the identical primes together
                               before running a {} dfn on them
           1,⍵                 We append 1 to each group.
        ⊂×\                    Then we get a list of powers of each prime,
                               and enclose the groups to remove 0s from uneven rows.
      ⌽                        This reverses the prime power groups.
  ∘.×/                         This multiplies all the powers together into
                               a matrix of the divisors of our input.
 ∊                             And this turns the matrix into a list of divisors
                               sorted by prime factorization.
                               We return implicitly, and we're done.

J, 32 31 bytes
[:(*/@#~>:#:[:i.[:*/>:)&|./2&p:

Grabs the lists of primes and exponents of the input integer, reverse each, and build up the divisors from that.
Usage
   f =: [:(*/@#~>:#:[:i.[:*/>:)&|./2&p:
   f 2
1 2
   f 72
1 2 4 8 3 6 12 24 9 18 36 72
   f 101
1 101

Explanation
[:(*/@#~>:#:[:i.[:*/>:)&|./2&p:  Input: n
                           2&p:  Factor n as a list where the first row are the primes
                                 and the second are their exponents
[:                     &|./      Reverse each list
                    >:           Increment each exponent by 1
                [:*/             Reduce it using multiplication
            [:i.                 Construct a range from 0 to that product exclusive
        >:                       The list of each exponent incremented
          #:                     Reduce each number in the previous range as a mixed base
                                 using the incremented exponents
      #~                         For each mixed base value in that range, copy from
                                 the list of primes that many times
   */@                           Reduce the copied primes using multiplication
                                 Return this list of products as the result

Ruby, 71 bytes
This answer is based on xnor's Python 2 answer.
->n{a,=t=[1];(s=t;a+=1;(t=s+t.map{|z|z*a};n/=a)while n%a<1)while n>1;t}

A same-length alternative is:
->n{a,=t=[1];(a+=1;(t+=t.map{|z|z*a};n/=a)while n%a<1)while n>1;t.uniq}

Ungolfing:
def f(num)
  factor = 1
  list = [1]
  while num != 1
    s = list
    factor += 1
    while num % factor == 0
      list = s + list.map{|z| z*factor}
      num /= factor
    end
  end
  return list
end

def g(num)
  factor = 1
  list = [1]
  while num != 1
    factor += 1
    while num % factor == 0
      list += list.map{|z| z*factor}
      num /= factor
    end
  end
  return list.uniq
end

Japt,  12 9 bytes
â mk ñÔ®×

-3 bytes thanks to @Shaggy
Try it online!

This should work for 9 bytes.

@Shaggy Oh yeah, forgot simple functions should be defined that way, even though I just suggested it for ASCII-only lol

Japt, 7 bytes
â ñ_k w

Run it online

Mathematica, 56 bytes
1##&@@@Tuples@Reverse[#^Range[0,#2]&@@@FactorInteger@#]&

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

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


text:
Legalize Reversed Date
Input:
A Date (containing dd, MM and yyyy). A date-object, or three separate integers are also valid as input.
Output:
Each part (dd, MM and yyyy) individually reverted and than rounded to the nearest valid date.
For example (in the format dd-MM-yyyy):
21-10-2016 becomes 12-01-6102
Challenge rules:

Only dd, MM, yyyy is valid, but the order and which separate-symbols you use is your own choice.
So these are some valid format examples: dd-MM-yyyy; MM/dd/yyyy; yyyy MM dd; ddMMyyyy, etc.
And these are some invalid format examples: dd MMM yyyy; dd-MM-'yy; etc.
You can also choose to just input a Date-object if your language supports it or three separate integer parameters, instead of the string representing a date.
Please state which date-format you've used! (And the input and output must be in the same format.) It is also allowed to output a Date-object, as long as it can handle all test cases and the challenge rule below.
The Julian to Gregorian Calendar transition is ignored for this challenge. So 1582 is just a valid reversed year for 2851.
See Challenge info / tips for all valid years, months and days.
Since you cannot have February as reversed of any other month, you don't have to worry about leap years.

All reversed years, months and days:

The year can always be reversed without a problem, reaching from 0001 (reversed of 1000) to 9999 (remains 9999). (So 0000 isn't a valid input, and there are also no test cases for it.)
The only months you'll have reversed are: January (reversed from October / 10); October (reversed from January / 01); November (remains November / 11); and December (reversed from every other month / 02-09, 12).
The only days you'll have reversed are: 01 (reversed from 10), 02 (reversed from 20), 03 (reversed from 30), 10 (reversed from 01), 11 (remains 11), 12 (reversed from 21), 13 (reversed from 31), 20 (reversed from 02), 21 (reversed from 12), 22 (remains 22), 30 (reversed from 03 or the same as 31 for November!), 31 (reversed from 04-09 / 13-19 / 23-29).

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return statements/output, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if necessary.

Test cases (dd-MM-yyyy as format):
21-07-2016   ->   12-12-6102
12-11-1991   ->   21-11-1991
01-01-2000   ->   10-10-0002
27-08-1875   ->   31-12-5781
18-12-2010   ->   31-12-0102
13-01-1981   ->   31-10-1891
04-11-1671   ->   30-11-1761  // Semi-tricky case, since November has 30 days
28-11-2036   ->   30-11-6302  // Semi-tricky case, since November has 30 days
14-06-1855   ->   31-12-5581
30-10-9999   ->   03-01-9999
01-01-2851   ->   10-10-1582

@LegionMammal978 No, 21-07-2016 is reverted 12-70-6102 which is rounded to 12-12-6102. Not sure how you get the result ##-10-6107..

@KevinCruijssen Okay, I thought it was that the month 70 wrapped around, with the year incrementing.

Is 10-10-2 valid output in the third case?

@LuisMendo Yeah sure. I've seen other people do it as well. The challenge is more about correctly reversing and rounding the dates than the in- or output format.

Would it be acceptable to take three strings, and expect leading zeros?

Convex, 23 bytes
Byte count assumes CP-1252 encoding.
qS/Wf%_1=:=31^sCs¶.e<S*

I/O format is dd mm yyyy.
Try it online!
This is a direct port of my CJam answer. Convex is heavily based on CJam, and therefore the only difference is the use of Convex's ¶ operator which wraps the top two stack elements in a list, saving a byte over [...].

CJam, 24 bytes
qS/Wf%[_1=:=31^sCs].e<S*

I/O format is dd mm yyyy.
Try it online!
Same byte count, I/O format mm dd yyyy:
qS/Wf%_0=:=1231^s2/.e<S*

Try it online!
Explanation
qS/     e# Read input, split around spaces.
Wf%     e# Reverse each component.
[       e# Set marker for new list.
  _1=   e#   Duplicate reversed strings, extract reversed month.
  :=    e#   Check for equality of the characters. This gives 1 for
        e#   November (11) and 0 for everything else.
  31^   e#   XOR the result with 31, giving 30 for November and 31
        e#   for everything else.
  s     e#   Convert the result to a string, "30"/"31".
  Cs    e#   Push 12, convert to string, "12".
]       e# Wrap "30"/"31" and "12" in a list.
.e<     e# Element-wise minimum. This clamps the day and month to their
        e# respective maxima.
S*      e# Join the result with spaces.

The other version works similarly, except that we start from the integer 1230 or 1231 before converting it to ["12" "30"]  or ["12" "31"].

Languages with date built-in...

@LeakyNun This doesn't use a date built-in and I don't see how it would help.

Then how do you know that there are 30 days in November?

@LeakyNun I'll add an explanation later, but 1= gets the reversed month, := checks whether its digits are equal and ^ xors the result into 31, giving 30 for month 11 and 31 for everything else.

Oh, I didn't read the specs...

Pyth, 55 53 46 43 41 bytes

APJ_Mczd=HhS,12sH=GhS,sGC@."❤❤ó»î"H%"%02d %02d %s"[GHeJ
APJ_Mczd=hS,12sH=hS,sGC@."❤❤ó»î"H%"%02d %02d %s"[GHeJ
APJ_Mcz\-%"%02d %02d %s"[hS,sGx31q11sHhS,12sHeJ
APJ_Mczdjd[>2+\0hS,sGx31q11sH>2+\0hS,12sHeJ
APJ_Mczdjd.[L\02[`hS,sGx31q11sH`hS,12sHeJ

where ❤❤ were two unprintables, respectively U+001C and U+001F.
Test suite.

Dyalog APL, 32 33 bytes
⍕¨{⍵-3↑31 11≡2↑⍵}31 12 1E4⌊⍎∊⍕⌽¨⎕

I/O is list of three strings ('dd' 'mm' 'yyyy').
TryAPL, but note that ⎕ (prompt for input) has been replaced with ⍵ and the entire line enclosed in {...} to enable online testing, and ⍎ (execute expression) has been replaced with 2⊃⎕VFI (verify and fix input) because execution of arbitrary code is blocked.

Python 3, 82 bytes
lambda x:[min(x[0][::-1],['31','30'][x[1]=='11']),min(x[1][::-1],'12'),x[2][::-1]]

An anonymous function that takes input, via argument, of the date as a list of strings of the form ['dd', 'mm', 'yyyy'] and returns the validated reversed date in the same format.
How it works
Python compares characters and strings by their Unicode code-points. This means that any comparison on two or more integers returns the same as that comparison on those integers as strings. Hence, calling min on two integers as strings returns the smallest integer as a string; by taking the reversed date-part as one argument and the maximum value as another, the day and month are clamped to the desired range. The date-parts are reversed by indexing with steps of -1 ([::-1]), and the maximum value for the month is changed from '31' to '30' if the month is November by indexing into a list with the Boolean result of a conditional.
Try it on Ideone

C# 314 305 299 249 232 223 Bytes
using System.Linq;string f(int d,int m,int y){Func<int,string>r=i=>string.Concat((""+i).PadLeft(2,'0').Reverse());Func<string,int,string>x=(j,k)=>int.Parse(j)>k?""+k:j;return x(r(d),m==11?30:31)+"-"+x(r(m),12)+"-"+r(y);}

Thanks to @KevinCruijssen for pointing out that I could shorten my variable declaration, which also made aliasing string able to save some bytes.
Saved 50 bytes storing the reversing function for reuse and another 13 by doing the same for the rounding and removing the variable declarations.
Last update makes aliasing string no longer a byte saver.
Ungolfed Version:
using System.Linq;
    string dateReverse(int day, int month, int year)
{
    //setup a resuable function to reverse
    Func<int, string> reverse = intToReverse => string.Concat((""+intToReverse).PadLeft(2, '0').Reverse());

    //another function for rounding
    Func<string, int, string> round = (strToRound, maxVal) => int.Parse(strToRound) > maxVal ? "" + maxVal : strToRound;

    //Join the strings into the "dd-mm-yyyy" date format
    return
        //Round down the day value, if november cap to 30 otherwise cap to 31
        round(reverse(day), month == 11 ? 30 : 31) + "-" +

        //Round the month down
        round(reverse(month), 12) + "-" +

        //we can use the reverse function here too and pad left just won't do anything
        reverse(year);
}

Test it here

You can ignore the space between using System.Linq; and the function, so that's -1 byte. Also, var n=...;var e=...; can be golfed by 1 byte using this instead: string n=...,e=...; It's not much, but still -2 bytes. ;)

Nice catch on that space, though it looks like my byte count actually didn't count it, so ill chock that up to a copy paste issue. Also I think using that variable declaration style Ill be able to win a few more bytes by aliasing string.

Javascript, 106 105 94 bytes
d=>d.split`,`.map((a,b,r)=>(e=[...a].reverse().join``,f=!b?r[1]==11^31:b<2&&12,f&&f<e?f:e))+''

Test suite (rev. 3)

Explanation
d=>d.split`,`                 // split into sections by `,`

.map((a,b,r)=>(               // map each section

e=[...a].reverse().join``,    // spread a date section into array and reverse and
                              // join with `` to get string result

f=!b?r[1]==11^31              // if section being mapped is day (section 0),
                              // then max (f) is 30 for November(month 11) or else 31

:b<2&&12,                     // if part being mapped is month (section 1), then max (f) is 12

f&&f<e?f:e))                  // if there is a max (f)
                              // and the max (f) is less than the reversed string (e),
                              // then return the max (f),
                              // else return the reversed string (e)

+''                           // join all the sections back together with `,`
                              // (concatenating [] with a string will do this)

Thanks @KevinCruijssen for saving 1 byte for b==1 to b<2.
Thanks @Neil for saving 11 bytes by suggesting ES6 template literal and , separator.

I'm pretty bad at JS, so correct me if I say something wrong, but can't b==1 be golfed down to b<2 to save a byte? It can't be 0 anymore, since you've already checked that at the !b? part of the code. It seems to work in your test suite when I change it.

@KevinCruijssen yep, you're right, thanks! I just overlooked it. I haven't done golfing in javascript for very look so I miss things like that sometimes

*I meant 'for very long', not 'for very look'

As you're targeting ES6, you can use template strings to shorten your code - join\`instead ofjoin('')for example - but you can save a little more by using,as your separator, which allows you to use+''` to join the three values together.

@Neil you mean , as the separator in the input?

My understanding is that you're allowed any separator, as long as you're consistent. Using a , allows you to stringify to join with commas on output, although obviously you still need to split\,`` on input.

Ok, I wasn't aware of that

Ruby, 92 84 + 1 (-p flag) = 93 85 bytes
Uses - as the seperator.
d,m,y=chomp.split(?-).map &:reverse
$_=[[d,m=="11"?"30":"31"].min,[m,"12"].min,y]*?-

Pyke, 29 bytes
F_bw-o^tDI]SX(mhj_Xjth~%R@]Sh

Try it here!
I can definitely see this being golfable

Python 2, 154 bytes
z=input().split("-");r=[x[::-1]for x in z];z[1]=r[1]if r[1]<'12'else '12';z[0]=r[0]if r[0]<'31'else '30'if z[1]=='11'else '31';z[2]=r[2];print "-".join(z)

Takes the input as a string, so quotes need to be specified in the input, e.g. "11-04-2016".

Just a basic improvement since I'm not a Python golfer: z=[x[::-1]for x in z];z[1]=min(z[1],'12');z[0]=min(z[0],['31','30'][z[1]=='11']);print"-".join(z). Basically, you don't need to use r at all, and min accomplishes a lot of the things you want to do.

05AB1E, 24 bytes
#íÐÅsË31^12‚øεßт+¦}sθªðý

Port of @MartinEnder's CJam answer, so also inputs and outputs as a string in the format dd MM yyyy.
Try it online or verify all test cases.
Explanation:
#                         # Split the (implicit) input by spaces
                          #  i.e. "04 11 1671" → ["04","11","1671"]
                          #  i.e. "20 01 2000" → ["20","01","2000"]
 í                        # Reverse each string
                          #  i.e. ["04","11","1671"] → ["40","11","1761"]
                          #  i.e. ["20","01","2000"] → ["02","10","0002"]
  Ð                       # Triplicate this list
   Ås                     # Pop one of them, and push it's middle element (the months)
                          #  i.e. ["40","11","1761"] → "11"
                          #  i.e. ["02","10","0002"] → "10"
     Ë                    # Check if the digits are the same (1 for 11; 0 otherwise)
                          #  i.e. "11" → 1 (truthy)
                          #  i.e. "10" → 0 (falsey)
      31^                 # Bitwise-XOR with 31 (30 for November, 31 for other months)
                          #  i.e. 1 → 30
                          #  i.e. 0 → 31
         12‚              # Pair it with 12
                          #  i.e. 30 → [30,12]
                          #  i.e. 31 → [31,12]
            ø             # Zip/transpose; swapping rows and columns
                          # (implicitly removes year)
                          #  i.e. ["40","11","1761"] and [30,12] → [["40",30],["11",12]]
                          #  i.e. ["02","10","0002"] and [31,12] → [["02",31],["10",12]]
             ε    }       # Map each pair to:
              ß           # Get the minimum (implicitly converts to integer unfortunately)
                          #  i.e. [["40",30],["11",12]] → [30,11]
                          #  i.e. [["02",31],["10",12]] → [2,10]
               т+         # Add 100
                          #  i.e. [30,11] → [130,111]
                          #  i.e. [2,10] → [102,110]
                 ¦        # Remove the first character
                          #  i.e. [130,111] → ["30","11"]
                          #  i.e. [102,110] → ["02","10"]
                   s      # Swap so the triplicated list is at the top of the stack again
                    θ     # Pop and only leave it's last element (the year)
                          #  i.e. ["40","11","1761"] → "1761"
                          #  i.e. ["02","10","0002"] → "0002"
                     ª    # Append it to the list
                          #  i.e. ["30","11"] and "1761" → ["30","11","1761"]
                          #  i.e. ["02","10"] and "0002" → ["02","10","0002"]
                      ðý  # Join the list by spaces (and output implicitly)
                          #  i.e. ["30","11","1761"] → "30 11 1761"
                          #  i.e. ["02","10","0002"] → "02 10 0002"


text:
Calculate the number e
From Wikipedia:

The number e is an important mathematical constant that is the base of the natural logarithm. It is approximately equal to 2.71828, and is the limit of (1 + 1/n)n as n approaches infinity.

Challenge
Calculate the number e to 15 digits after the decimal point.
This means that your output must start with 2.718281828459045 or equivalent.
Your program can output digits after the required output - these may be accurate or inaccurate, inaccuracy after 15 digits does not disqualify you from the challenge. Your program may also output nothing after the required 15 digits.
This is code-golf, shortest implementation in bytes wins.
Constraints

You may not use built in constants or hardcode the number.
Standard loopholes and rules apply.

Reference Implementation (Ruby)
def e(i)
  e = 1.0                        # make it floating point
  i.times { |n|                  # loop repeats n times
    e += 1.0/(1..n+1).reduce(:*) # factorial - no factorial function
  }                              # in the Ruby standard library
  return e
end
e(200)                           # Almost certainly will return e

Uh, the built in constant part is a bit unclear, what if I do exp(1)? What about (-1)^(1/i*pi))?

You mention the lim, but then your reference uses the series sum...

Sorry, a search didn't find the previous question.

@Adám The quote is copy pasted from Wikipedia. The article also shows the series sum formula.

@FryAmTheEggman Use your common sense. Please don't try getting around the rules.

Haskell, 33 31 Bytes
-2 Bytes thanks to @xnor
sum[1/product[1..i]|i<-[0..99]]

Straightforward implementation of the series definition. (I have posted a version of this to Reddit before.)

You don't need parens around the product.

Haskell, 25 bytes
f 99=0;f n=1+f(n+1)/n;f 0

26 bytes:
foldr(\x y->1+y/x)0[1..99]


text:
Verify a Tower of Hanoi solution
If you don't know what the Tower of Hanoi is, I'll explain it briefly: There are three rods and some discs each of which has a different size. In the beginning all discs are on the first tower, in sorted order: The biggest one is at the bottom, the smallest at the top. The goal is to bring all the discs over to the third rod. Sounds easy? Here's the catch: You can't place a disc on top of a disc that is smaller than the other disc; you can only hold one disc in your hand at a time to move them to another rod and you can only place the disc on rods, not on the table, you sneaky bastard.
ascii example solution:
  A      B      C
  |      |      |
 _|_     |      |
__|__    |      |

  A      B      C
  |      |      |
  |      |      |
__|__   _|_     |

  A      B      C
  |      |      |
  |      |      |
  |     _|_   __|__

  A      B      C
  |      |      |
  |      |     _|_
  |      |    __|__

Challenge
There are three rods called A,B and C. (You can also call them 1,2 and 3 respectivly if that helps) In the beginning all n discs are on rod A(1).
Your challenge is to verify a solution for the tower of hanoi. You'll need to make sure that:

In the end all n discs are on rod C(3).
For any given disc at any given state there is no smaller disc below it.
No obvious errors like trying to take discs from an empty rod or moving discs to nonexistant rods.

(the solution does not have to be optimal.)
Input
Your program will receive two inputs:

The number of discs n (an integer)
The moves which are taken, which will consist of a set of tuples of: (tower to take the currently uppermost disc from),(tower to take this disc to) where each tuple refers to a move. You can choose how they are represented. For example something like the following ways of representing the solution for n=2 which I've drawn in ascii above. (I'll use the first one in the test cases, because it's easy on the eyes):
"A->B ; A->C ; B->C"
[("A","B"),("A","C"),("B","C")]
[(1,2),(1,3),(2,3)]
"ABACBC"
[1,2,1,3,2,3]

Output

Truthy, if the conditions that can be found under "challenge" hold.
Falsy, if they don't.

Test cases:
True:
n=1, "A->C"

n=1, "A->B ; B->C"

n=2, "A->B ; A->C ; B->C"

n=2, "A->C ; C->B ; A->C ; B->C"

n=2, "A->C ; A->B ; C->B ; B->A ; B->C ; A->C"

n=3, "A->C ; A->B ; C->B ; A->C ; B->A ; B->C ; A->C"

n=4, "A->B ; A->C ; B->C ; A->B ; C->A ; C->B ; A->B ; A->C ; B->C ; B->A ; C->A ; B->C ; A->B ; A->C ; B->C"

False:
3rd one suggested by @MartinEnder, 7th by @Joffan
n=1, "A->B"

n=1, "C->A"

n=2, "A->C ; A->B ; C->B ; A->C ; B->A ; B->C ; A->C"

n=2, "A->B ; A->C ; C->B"

n=2, "A->C ; A->B ; C->B ; B->A"

n=2, "A->C ; A->C"

n=3, "A->B ; A->D; A->C ; D->C ; A->C"

n=3, "A->C ; A->C ; A->B ; C->B ; A->C ; B->A ; B->C ; A->C"

n=3, "A->C ; A->B ; C->B ; A->B ; B->C ; B->A ; B->C ; A->C"

n=3, "A->C ; A->B ; C->B ; A->C ; B->A ; B->C ; C->B"

n=4, "A->B ; A->C ; B->C ; A->B ; C->A ; C->B ; A->B ; A->C ; B->C ; B->A ; C->A ; B->C ; A->B ; A->C"

n=4, "A->B ; A->B ; A->B ; A->C ; B->C ; B->C ; B->C"

This is code-golf, shortest solution wins. Standard rules and loopholes apply. No batteries included.

Is it also okay if the 2nd input can be represented using your method, but using numbers instead of letters (i.e. A=1, B=2, C=3, etc.)?

@R.Kap: Sure, that's fine.

May I zero index the inputs?

for the second input

@RohanJhunjhunwala sure, why not

Is it okay if an error is thrown when a disk is taken from an empty or nonexistent rod?

@R.Kap Some may say that's falsy, so it's ok.

Can we assume that there won't be non-moves like A->A?

@MartinEnder yes

On the 7th False example, is that a D!?

@Kobi you have to check for moving discs to nonexistant rods. so of course yes, it's a D

Retina, 84 80 Bytes
-5 bytes thanks to Martin Ender
~
 ~$'
$
ABC
{`^(.)(.*)( ~+)\1
$3$2$1
}`^(\W+)(\w)(.*)(?<=\1~+|\w)\2
$3$1$2
^AB

Try it online! (plus 5 bytes for line-by-line tests)
The code simulates a full game.

Input is given as ACABCBACBABCAC~~~.
~~~ means three discs.
First four lines convert the input to the game format: ACABCBACBABCAC ~~~ ~~ ~ABC.
In the beginning the A rod has all 3 discs, and B and C rods are empty.
Next we have a loop of two steps:

Take the first letter in the line, which indicates the next source rod. Find this rod, and take the last disc on in. Remove the letter and move the disc to the stark (pick it up).
In out example, after the first step, the text will look like:
~CABCBACBABCAC ~~~ ~~ABC.
In the second stage we find the target rod, and move the disc there. We validate the rod is empty, or has a bigger disc at the top: ABCBACBABCAC ~~~ ~~AB ~C.

Finally we confirm the A and B rods are empty - this means all discs are in C (there's an extra space at the last line).

Wow, thats impressive

Retina, 167 165 157 150 123 bytes
This totally looks like a challenge that should be solved with a single regex... (despite the header saying "Retina", this is just a vanilla .NET regex, matching valid inputs).
^(?=\D*((?=(?<3>1+))1)+)((?=A(?<1-3>.+)|B(?<1-4>.+)|C(?<1-5>.+)).(?=A.*(?!\3)(\1)|B.*(?!\4)(\1)|C.*(?!\5)(\1)).)+(?!\3|\4)1

Input format is the list of instructions of the form AB, followed by n in unary using the digit 1. There are no separators. Output is 1 for valid and 0 for invalid.
Try it online! (The first two characters enable a linefeed-separated test suite.)
Alternative solution, same byte count:
^(?=\D*((?=(?<3>1+))1)+)((?=A(?<1-3>.+)|B(?<1-4>.+)|C(?<1-5>.+)).(?=A.*(?!\3)(\1)|B.*(?!\4)(\1)|C.*(?!\5)(\1)).)+(?<-5>1)+$

This can possibly be shortened by using 1, 11 and 111 instead of A, B and C but I'll have to look into that later. It might also be shorter to split the program into several stages, but where's the challenge in that? ;)
Explanation
This solution makes heavy use of .NET's balancing groups. For a full explanation see my post on Stack Overflow, but the gist is that capturing groups in .NET are stacks, where each new capture pushes another substring and where it's also possible to pop from such a stack again. This lets you count various quantities in a string. In this case it lets us implement the three rods directly as three different capturing groups where each disc is represented by a capture.
To move discs around between rods we make use of a weird quirk of the (?<A-B>...) syntax. Normally, this pops a capture from stack B and pushes onto stack A the string between that popped capture and the beginning of this group. So (?<A>a).(?<B-A>c) matched against abc would leave A empty and B with b (as opposed to c). However, due to .NET variable-length lookbehinds it's possible for the captures of (?<A>...) and (?<B-A>...) to overlap. For whatever reason, if that's the case, the intersection of the two groups is pushed onto B. I've detailed this behaviour in the "advanced section" on balancing groups in this answer.
On to the regex. Rods A, B and C correspond to groups 3, 4 and 5 in the regex. Let's start by initialising rod A:
^                 # Ensure that we start at the beginning of the input.
(?=               # Lookahead so that we don't actually move the cursor.
  \D*             # Skip all the instructions by matching non-digit characters.
  (               # For each 1 at the end of the input...
    (?=(?<3>1+))  # ...push the remainder of the string (including that 1)
                  # onto stack 3.
  1)+
)

So e.g. if the input ends with 111, then group 3/rod A will now hold the list of captures [111, 11, 1] (the top being on the right).
The next bit of the code has the following structure:
(
  (?=A...|B...|C...).
  (?=A...|B...|C...).
)+

Each iteration of this loop processes one instruction. The first alternation pulls a disc from the given rod (onto a temporary group), the second alternation puts that that disc onto the other given rod. We'll see in a moment how this works and how we ensure that the move is valid.
First, taking a disc off the source rod:
(?=
  A(?<1-3>.+)
|
  B(?<1-4>.+)
|
  C(?<1-5>.+)
)

This uses the weird group-intersection behaviour I've described above. Note that group 3, 4 and 5 will always hold substrings of 1s at the end of the string whose length corresponds to the disc's size. We now use (?<1-N>.+) to pop the top disc off stack N and push the intersection of this substring with the match .+ onto stack 1. Since .+ always necessarily covers the entire capture popped off N, we know that this simply moves the capture.
Next, we put this disc from stack 1 onto the stack corresponding to the second rod:
(?=
  A.*(?!\3)(\1)
|
  B.*(?!\4)(\1)
|
  C.*(?!\5)(\1)
)

Note that we don't have to clean up stack 1, we can just leave the disc there, since we'll put a new one on top before using the stack again. That means we can avoid the (?<A-B>...) syntax and simply copy the string over with (\1). To ensure that the move is valid we use the negative lookahead (?!\N). This ensures that, from the position where we want to match the current disc, it's impossible to match the disc already on stack N. This can only happen if either a) \N will never match because the stack is completely empty or b)the disc on top of stackNis larger than the one we're trying to match with\1`.
Finally, all that's left is ensuring that a) we've matched all instructions and b) rods A and B are empty, so that all discs have been moved onto C.
(?!\3|\4)1

We simply check that neither \3 nor \4 can match (which is only the case if both are empty, because any actual disc would match) and that we can then match a 1 so that we haven't omitted any instructions.

Java "only" 311 272 263 261 260 259 256 bytes
Saved 39 countless bytes due to @Frozn noticing an older debug feature as well as some clever golfing tricks.
Golfed version
int i(int n,int[]m){int j=0,k=0,i=n;Stack<Integer>t,s[]=new Stack[3];for(;j<3;)s[j++]=new Stack();for(;i-->0;)s[0].push(i);for(;k<m.length;k+=2)if((t=s[m[k+1]]).size()>0&&s[m[k]].peek()>t.peek())return 0;else t.push(s[m[k]].pop());return s[2].size()<n?0:1;}

ungolfed with explanation and pretty printed stacks at each step
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package codegolf;

/**
 *
 * @author rohan
 */
import java.util.Arrays;
import java.util.Stack;
public class CodeGolf {
    //golfed version
    int i(int n,int[]m){int j=0,k=0,i=n;Stack<Integer>[] s=new Stack[3];for(;j<3;j++)s[j]=new Stack();for(;i-->0;)s[0].push(i);for(;k<m.length;System.out.println(Arrays.toString(s)),k+=2)if(!s[m[k+1]].isEmpty()&&s[m[k]].peek()>s[m[k+1]].peek())return 0;else s[m[k+1]].push(s[m[k]].pop());return s[2].size()==n?1:0;}
    /** Ungolfed
        * 0 as falsy 1 as truthy
        * @param n the number of disks
        * @param m represents the zero indexed stacks in the form of [from,to,from,to]
        * @return 0 or 1 if the puzzle got solved, bad moves result in an exception
        */
    int h(int n, int[] m) {
        //declarations
        int j = 0, k = 0, i = n;
        //create the poles
        Stack<Integer>[] s = new Stack[3];
        for (; j < 3; j++) {
            s[j] = new Stack();
        }
        //set up the first tower using the "downto operator
        for (; i-- > 0;) {
            s[0].push(i);
        }
    //go through and perform all the moves
        for (; k < m.length; System.out.println(Arrays.toString(s)), k += 2) {
            if (!s[m[k + 1]].isEmpty() && s[m[k]].peek() > s[m[k + 1]].peek()) {
                return 0;//bad move
            } else {
                s[m[k + 1]].push(s[m[k]].pop());
            }
        }
        return s[2].size() == n ? 1 : 0;// check if all the disks are done
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    //test case
        System.out.println( new CodeGolf().h(3,new int[]{0,2,0,1,2,1,0,2,1,0,1,2,0,2})==1?"Good!":"Bad!");
    }

}

The ungolfed version has a feature where it will print out what the stacks look like at each step like so...
[[2, 1], [], [0]]
[[2], [1], [0]]
[[2], [1, 0], []]
[[], [1, 0], [2]]
[[0], [1], [2]]
[[0], [], [2, 1]]
[[], [], [2, 1, 0]]
Good!

What does System.out.println(Arrays.toString(s)) do?

It will pretty print the stacks. Like so [[2,1,0],[][]]

Whoops @Frozn that was a debug feature removing now

I know, just wondering why it's there :) You can also replace && with &.

@Frozn I can not replace that sadly because I was relying on short circuit behavior to avoid trying to peek at an empty stack. Thanks for the 39 byte reduction

Oh yes you're right, just saw that... But I got something else: if(!s[j=m[k+1]].isEmpty()&&s[m[k]].peek()>s[j].peek())return 0;else s[j].push(s[m[k]].pop());. It will save you some characters. I'm reusing the unused variable j to shorten the multiple m[k+1]. Sadly this doesn't work for m[k] because of the short circuit... EDIT: return s[2].size()<n?0:1; as no more than n elements can be on the stack.

@Frozn genuis! sounds great, adding now

Let us continue this discussion in chat.

Replacing stack initialization loop to Stack<Integer>[] s = new Stack[]{new Stack(),new Stack(),new Stack()}; decreases the size of the solution

@Heisenberg sounds good

@Hesienberg it seems to have increased the length, I must be doing something wrong

@Heisenberh, yeah made it longer

did you remove the spaces and initialization of j

@Heseinberg let me check again

Yeah even after after doing that it seems to be longer. If you can get it to work, feel free to edit it in, and I will accept the edit. I canr tseem to figure it out

Python 2, 186 167 158 135 127 115 110 102 bytes
n,m=input()
x=[range(n),[],[]]
for a,b in m:p=x[a].pop();e=x[b];e and 1/(p>e[-1]);e+=p,
if x[0]+x[1]:_

Takes input on STDIN in the following format:
(1,[(0,1),(1,2)])

That is, a Python tuple of the number of discs and a Python list of tuples of (from_rod,to_rod). As in Python, the surrounding parentheses are optional. Rods are zero-indexed.
For example, this test case:
n=2; "A->B ; A->C ; B->C"

would be given as:
(2,[(0,1),(0,2),(1,2)])

If the solution is valid, outputs nothing and exits with an exit code of 0. If it is invalid, throws an exception and exits with an exit code of 1. Throws an IndexError if moving to a nonexistant rod or trying to take a disc off a rod that has no discs on it, a ZeroDivisionError if a disc is placed on top of a smaller disc, or a NameError if there are discs left on the first or second rods at the end.
Saved 13 bytes thanks to @KarlKastor!
Saved 8 bytes thanks to @xnor!

The check that each pile is sorted seems too complicated. Can't you just check that the moved disk is larger than the top disk of the pile it's moved onto?

@xnor Thanks, that should work. Adding it now.

VBA, 234 217 213 196 bytes
Function H(N,S)
ReDim A(N)
While P<Len(S)
P=P+2:F=1*Mid(S,P-1,1):T=1*Mid(S,P,1)
E=E+(T>2):L=L+T-F
For i=1 To N
If A(i)=F Then A(i)=T:Exit For
E=E+(A(i)=T)+(i=N)
Next
Wend
H=L+9*E=2*N
End Function

Input format for moves is a string with an even number of digits (012). Invocation is in spreadsheet, =H([number of discs], [move string])
The array A holds the rod position of the various discs. A move is simply updating the first occurrence of the "From" rod number into the "To" rod number. If you encounter a "To" rod disc first, or no "From" rod disc, it's an invalid move. The total "rod value" of A is held in L, which needs to end at 2N. Errors are accumulated as a negative count in E.
In common with other solutions, "moving" a disc from a tower to the same tower is not forbidden. I could forbid it for another 6 bytes.
Results
Function result in first column (the last n=3 case is my addition using an extra rod).
TRUE    1   02
TRUE    1   0112
TRUE    2   010212
TRUE    2   02210212
TRUE    2   020121101202
TRUE    3   02012102101202
TRUE    4   010212012021010212102012010212

FALSE   1   01
FALSE   1   20
FALSE   2   02012102101202
FALSE   2   010221
FALSE   2   02012110
FALSE   2   0202
FALSE   3   0202012102101202
FALSE   3   0201210112101202
FALSE   3   02012102101221
FALSE   3   0103023212
FALSE   4   0102120120210102121020120102
FALSE   4   01010102121212

Python 2.7, 173 158 138 130 127 123 bytes:
r=range;a,b=input();U=[r(a,0,-1),[],[]]
for K,J in b:U[J]+=[U[K].pop()]if U[J]<[1]or U[K]<U[J]else Y
print U[-1]==r(a,0,-1)

Takes input through the stdin in the format (<Number of Discs>,<Moves>) where <Moves> is given as an array containing tuples corresponding to each move, which each contain a pair of comma separated integers. For instance, the test case:
n=3, "A->C ; A->B ; C->B ; A->C ; B->A ; B->C ; A->C"

given in the post would be given as:
(3,[(0,2),(0,1),(2,1),(0,2),(1,0),(1,2),(0,2)])

to my program. Outputs an IndexError if the 3rd condition isn't met, a NameError if the 2nd condition isn't met, and False if the 1st condition isn't met. Otherwise outputs True.

two things: variable Y is never defined in your code (I think that should be J) and U[J]+=[Y,[U[K].pop()]][U[J]<[1]or U[K]<U[J]] is shorter by 3 characters that the stmt1 if cond else stmt2

@jermenkoo Well, I use that Y variable like that is to raise the NameError whenever the 2nd condition is not met. If I were to change Y to J, then the NameError would not be raised. For this reason, I also cannot do U[J]+=[Y,[U[K].pop()]][U[J]<[1]or U[K]<U[J]] because this would raise a NameError all the time, not just when the 2nd condition is not met.

alright, thanks for your explanation!

php, 141 bytes
<?php $a=$argv;for($t=[$f=range($a[++$i],1),[],[]];($r=array_pop($t[$a[++$i]]))&&$r<(end($t[$a[++$i]])?:$r+1);)$t[$a[$i]][]=$r;echo$t[2]==$f;

Command line script, takes input as the height then a series of array indexes (0 indexed) e.g. 1 0 2 or 2 0 1 0 2 1 2 for the 1 or 2 height shortest test cases.
Echos 1 on true cases and nothing on false ones.
Gives 2 notices and 1 warning so needs to be run in an environment that silences those.

JavaScript (ES6), 108
n=>s=>!s.some(([x,y])=>s[y][s[y].push(v=s[x].pop())-2]<v|!v,s=[[...Array(s=n)].map(_=>s--),[],[]])&s[2][n-1]

Input format: function with 2 arguments

arg 1, numeric, number of rings
arg 2, array of strings, each string 2 characters '0','1','2'

Output: return 1 if ok, 0 if invalid, exception if nonexisting rod
Less golfed and explained
n=>a=>(
  // rods status, rod 0 full with an array n..1, rod 1 & 2 empty arrays
  s = [ [...Array(t=n)].map(_=>t--), [], [] ],
  // for each step in solution, evaluate function and stop if returns true
  err = a.some( ([x,y]) => {
    v = s[x].pop(); // pull disc from source rod
    // exception is s[x] is not defined
    if (!v) return 1; // error source rod is empty
    l = s[y].push(v); // push disc on dest rod, get number of discs in l
    // exception is s[y] is not defined
    if(s[y][l-2] < v) return 1; // error if undelying disc is smaller
  }),
  err ? 0 // return 0 if invalid move
  : s[2][n-1]; // il all moves valid, ok if the rod 2 has all the discs
)

Test
Note: the first row of the Test function is needed to convert the input format given in the question to the input expected by my function

F=
n=>s=>!s.some(([x,y])=>s[y][s[y].push(v=s[x].pop())-2]<v|!v,s=[[...Array(s=n)].map(_=>s--),[],[]])&s[2][n-1]

Out=x=>O.textContent+=x+'\n'

Test=s=>s.split`\n`.map(r=>[+(r=r.match(/\d+|.->./g)).shift(),r.map(x=>(parseInt(x[0],36)-10)+''+(parseInt(x[3],36)-10))])
.forEach(([n,s],i)=>{
  var r
  try {
    r = F(+n)(s);
  }
  catch (e) {
    r = 'Error invalid rod';
  }
  Out(++i+' n:'+n+' '+s+' -> '+r)
})

Out('OK')
Test(`n=1, "A->C"
n=1, "A->B ; B->C"
n=2, "A->B ; A->C ; B->C"
n=2, "A->C ; C->B ; A->C ; B->C"
n=2, "A->C ; A->B ; C->B ; B->A ; B->C ; A->C"
n=3, "A->C ; A->B ; C->B ; A->C ; B->A ; B->C ; A->C"
n=4, "A->B ; A->C ; B->C ; A->B ; C->A ; C->B ; A->B ; A->C ; B->C ; B->A ; C->A ; B->C ; A->B ; A->C ; B->C"`)

Out('\nFail')
Test( `n=1, "A->B"
n=1, "C->A"
n=2, "A->C ; A->B ; C->B ; A->C ; B->A ; B->C ; A->C"
n=2, "A->B ; A->C ; C->B"
n=2, "A->C ; A->B ; C->B ; B->A"
n=2, "A->C ; A->C"
n=3, "A->B ; A->D; A->C ; D->C ; A->C"
n=3, "A->C ; A->C ; A->B ; C->B ; A->C ; B->A ; B->C ; A->C"
n=3, "A->C ; A->B ; C->B ; A->B ; B->C ; B->A ; B->C ; A->C"
n=3, "A->C ; A->B ; C->B ; A->C ; B->A ; B->C ; C->B"
n=4, "A->B ; A->C ; B->C ; A->B ; C->A ; C->B ; A->B ; A->C ; B->C ; B->A ; C->A ; B->C ; A->B ; A->C"
n=4, "A->B ; A->B ; A->B ; A->C ; B->C ; B->C ; B->C"`)
<pre id=O></pre>