I calculated to n=5, and from the pattern, it appears that the number of possible rankings is equal to 2^(n-1).
It's easiest to understand why if you see that for each n, the possibilities can be represented by a binary tree. For example, for n=1, you have a tree with only a single node (value = 1). Each time n increases, you would add another level to the tree, and each parent node will have exactly 2 children: either the same value as the parent or the value of the current level.
So, for n=2, you have 2 children underneath, one with value 1 (same as parent), and one with value 2 (value of the current tree level).
If you continue this process, you will see that each time you increase n by 1, you double the number of possible paths through the tree. Each path through the tree corresponds to a possible ranking. I hope that helps.
!enter image description here