pre-computing n