What is the number of lines that pass through the center of an n-dimensional tic-tac-toe grid?



tic-tac-toe n-dimensional
The squares tic tac toe grid can be represented with $(x^1,x^2,...,x^n)$ where each can be 0, 1 or 2.


A line passing through the center can be identified Given any coordinate except $(0,0,...,0)$.


There are $3^n-1$ possible coordinates to start a line from.


For each line through center, there will be two endpoints. This should help you get your answer.


