Determining the number of valid TicTacToe board states in terms of board dimension I am attempting to find a closed form equation in terms of $n$, for the number of valid Tic-Tac-Toe board states (ignoring symmetry), where the board has dimension $n \times n ,\; 0 \lt n,\;n \in \Bbb Z $.
Tic-Tac-Toe Rules:


*

*The $X$ token moves first

*No player can abstain from moving

*The game ends when:


*

*All spaces are filled

*$n$ identical horizontal, vertical, or diagonal tokens exits 



From these rules, how can we derive a closed form equation of the number of valid Tic-Tac-Toe board states when the board's dimension changes in terms of $n\,$?

Observations of small values of $n$:
$\;n = 1: 2\;$ valid board states (by enumeration) 
[ ], [X]

$\;n = 2: 29\;$ valid board states (by enumeration)
[ ][ ]  [X][ ]  [ ][X]  [ ][ ]  [ ][ ]  [X][O]  [X][ ]  [X][ ]  [O][X]  
[ ][ ], [ ][ ], [ ][ ], [X][ ], [ ][X], [ ][ ], [O][ ], [ ][O], [ ][ ],

[ ][X]  [ ][X]  [O][ ]  [ ][O]  [ ][ ]  [O][ ]  [ ][O]  [ ][ ]  [X][O]  
[O][ ], [ ][O], [X][ ], [X][ ], [X][O], [ ][X], [ ][X], [O][X], [X][ ],

[X][O]  [X][X]  [X][ ]  [X][X]  [X][ ]  [O][X]  [O][X]  [ ][X]  [ ][X]  
[ ][X], [O][ ], [O][X], [ ][O], [X][O], [X][ ], [ ][X], [O][X], [X][O], 

[O][ ]  [ ][O]
[X][X], [X][X]

$\;n = 3: 255,168\;$ valid board states (by reference)

I disagree with some of the results in the N=3 column in the table above.
I agree with the values cited for up through ply 5.
But from that point on:
    ply:      table value:       my value:
     6           1520               1680
     7           1140               1260  
     8            390                630
     9             78                126  
    total for 9 plys:
                 5478               6046  
Basis: formula for N things taken R at a time  N! /(R! x (N-R)!
EX: Ply 7:   N = 9, R = 4 for X  9! / (4!)(9-4)! = 126
             N = 5, R = 3 for O  5! / (3!)(5-3)! = 10
             126 x 10 = 1260

