3 replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
source | link

Actually, 18 11 bytes

This answer uses the algorithm in Dennis' Jelly answerDennis' Jelly answer but is 0-indexed. Golfing suggestions welcome! Try it online!

4╞r;)╨E╨♂#í

Ungolfing

      Implicit input n.
4╞    Push 4 duplicates of n. Stack: n, n, n, n
r;)   Push the range [0...n], and move a duplicate of that range to BOS for later.
╨E    Push the n-length permutations of [0...n] and get perm_list[n].
        Stack: perm_list[n], n, [0...n]
╨     Push the n-length permutations of perm_list[n].
♂#    Convert every "list" in the zip to an actual list.
        Stack: perm(perm_list[n]), [0...n]
í     Get the index of [0...n] in the list of permutations of perm_list[n].
      Implicit return.

Actually, 18 11 bytes

This answer uses the algorithm in Dennis' Jelly answer but is 0-indexed. Golfing suggestions welcome! Try it online!

4╞r;)╨E╨♂#í

Ungolfing

      Implicit input n.
4╞    Push 4 duplicates of n. Stack: n, n, n, n
r;)   Push the range [0...n], and move a duplicate of that range to BOS for later.
╨E    Push the n-length permutations of [0...n] and get perm_list[n].
        Stack: perm_list[n], n, [0...n]
╨     Push the n-length permutations of perm_list[n].
♂#    Convert every "list" in the zip to an actual list.
        Stack: perm(perm_list[n]), [0...n]
í     Get the index of [0...n] in the list of permutations of perm_list[n].
      Implicit return.

Actually, 18 11 bytes

This answer uses the algorithm in Dennis' Jelly answer but is 0-indexed. Golfing suggestions welcome! Try it online!

4╞r;)╨E╨♂#í

Ungolfing

      Implicit input n.
4╞    Push 4 duplicates of n. Stack: n, n, n, n
r;)   Push the range [0...n], and move a duplicate of that range to BOS for later.
╨E    Push the n-length permutations of [0...n] and get perm_list[n].
        Stack: perm_list[n], n, [0...n]
╨     Push the n-length permutations of perm_list[n].
♂#    Convert every "list" in the zip to an actual list.
        Stack: perm(perm_list[n]), [0...n]
í     Get the index of [0...n] in the list of permutations of perm_list[n].
      Implicit return.
2 More golfing
source | link

Actually, 1818 11 bytes

This answer uses the algorithm in Dennis' Jelly answer but is 0-indexed. Golfing suggestions welcome! Try it online!Try it online!

;;r;)╨#;4╞r;)EZ♂#S♂N@í╨E╨♂#í

Ungolfing

      Implicit input n.
;;4╞    DuplicatePush n4 twiceduplicates of n. Stack: n, n, n, n
r;)   Push the range [0...n], and move a duplicate of that range to BOS for later.
╨#╨E    Push the n-length permutations of [0...n] and convert to a list. Call thisget perm_listperm_list[n].
;)    Duplicate perm_list and rotate toStack: BOSperm_list[n], forn, later[0...n]
EZ    Get perm_list[n] and zip it withPush the othern-length copypermutations of range [0...n]perm_list[n].
♂#    Convert every "list" in the zip to an actual list.
S     Sort the lists by the perm_listStack: indicesperm(perm_list[n]), effectively inverting the permutation[0...n]
♂Ní     Get the inverse permutation from theindex sortedof zip[0.
@í    Swap..n] within the duplicate perm_list and getlist theof indexpermutations of the permutationperm_list[n].
      Implicit return.

Actually, 18 bytes

This answer uses the algorithm in Dennis' Jelly answer but is 0-indexed. Golfing suggestions welcome! Try it online!

;;r;)╨#;)EZ♂#S♂N@í

Ungolfing

      Implicit input n.
;;    Duplicate n twice.
r;)   Push the range [0...n], and move a duplicate of that range to BOS for later.
╨#    Push the n-length permutations of [0...n] and convert to a list. Call this perm_list.
;)    Duplicate perm_list and rotate to BOS for later.
EZ    Get perm_list[n] and zip it with the other copy of range [0...n].
♂#    Convert every "list" in the zip to an actual list.
S     Sort the lists by the perm_list indices, effectively inverting the permutation.
♂N    Get the inverse permutation from the sorted zip.
@í    Swap with the duplicate perm_list and get the index of the permutation.
      Implicit return.

Actually, 18 11 bytes

This answer uses the algorithm in Dennis' Jelly answer but is 0-indexed. Golfing suggestions welcome! Try it online!

4╞r;)╨E╨♂#í

Ungolfing

      Implicit input n.
4╞    Push 4 duplicates of n. Stack: n, n, n, n
r;)   Push the range [0...n], and move a duplicate of that range to BOS for later.
╨E    Push the n-length permutations of [0...n] and get perm_list[n].
        Stack: perm_list[n], n, [0...n]
     Push the n-length permutations of perm_list[n].
♂#    Convert every "list" in the zip to an actual list.
        Stack: perm(perm_list[n]), [0...n]
í     Get the index of [0...n] in the list of permutations of perm_list[n].
      Implicit return.
1
source | link

Actually, 18 bytes

This answer uses the algorithm in Dennis' Jelly answer but is 0-indexed. Golfing suggestions welcome! Try it online!

;;r;)╨#;)EZ♂#S♂N@í

Ungolfing

      Implicit input n.
;;    Duplicate n twice.
r;)   Push the range [0...n], and move a duplicate of that range to BOS for later.
╨#    Push the n-length permutations of [0...n] and convert to a list. Call this perm_list.
;)    Duplicate perm_list and rotate to BOS for later.
EZ    Get perm_list[n] and zip it with the other copy of range [0...n].
♂#    Convert every "list" in the zip to an actual list.
S     Sort the lists by the perm_list indices, effectively inverting the permutation.
♂N    Get the inverse permutation from the sorted zip.
@í    Swap with the duplicate perm_list and get the index of the permutation.
      Implicit return.