Find the sum of all primes a less than 1000 such that a^(k+1) + 1 = b^(m+1) , for some positive integers k,b,m.