A Mathematical Approach to Gomoku