You are viewing a single comment's thread. Return to all comments →
You probably don't want to use that formula. You have to double-loop anyways, one for starting number, the other for # of terms. It's much faster to add on a j*j than to compute that summation formula.
This problem really only comes down to having a fast palindrome check.