chess mathematical patterns