That's the default formula:
n - r + 1
This will award points exactly as you described. But it is based on the number of tournament entrants. If you have 20 players, 1st place will get 20 points, 2nd will get 19, etc, down to the last place receiving 1 point. If you have only 10 players in a tournament, 1st place will receive 10 points, 2nd will get 9, etc, with last still receiving 1 point.
If you want 1st place to ALWAYS get 20 points, regardless of how many players are actually in the tournament, use this one instead:
max(1, 21 - r)
With this formula, 1st place will always get 20 points, 2nd place will always get 19 points, etc. The minimum is 1, so everyone participating will always get 1 point no matter what rank. So if you happen to host a tournament where there are 25 players, ranks 20 through 25 will get 1 point.