generalized to odd numbers