Working for odd and even N values.