sum j^2-2j+2