user30339: What is the number of legal positions after n plies for n=1 through 5? I know that for n=1 it is 20.

user12873: A very rough approximation you can use is to multiply by 30 for each half move. Since in an average chess position, the number of possible moves tends to be in the ballpark of around 30 (of course, not for the starting position, but for chess positions in general). This should give you the answer within an order of magnitude or two. For an exact solution though, see Miguel's answer.

user32450: Such counting of moves is called perft and it is used for testing move generation of chess engines.
You can find a table with your answer up to n = 15 here:
https://www.chessprogramming.org/Perft_Results

30339: <p>What is the number of legal positions after n plies for n=1 through 5? I know that for n=1 it is 20.</p>
 12873: <p>A very rough approximation you can use is to multiply by 30 for each half move. Since in an average chess position, the number of possible moves tends to be in the ballpark of around 30 (of course, not for the starting position, but for chess positions in general). This should give you the answer within an order of magnitude or two. For an exact solution though, see Miguel's answer.</p>
 32450: <p>Such counting of moves is called perft and it is used for testing move generation of chess engines.</p>
<p>You can find a table with your answer up to n = 15 here:
<a href="https://www.chessprogramming.org/Perft_Results" rel="noreferrer">https://www.chessprogramming.org/Perft_Results</a></p>
