Center-of-mass motion on shell-model calculations with arbitrary central potential