Each of the capital letters in bold denotes a different base B digit from 0 to B-1. None of the letters can contain any leading zero.
SEND + LESS = MONEY
Determine the minimum value of B such that the total number of solutions of the above equation is a nonzero perfect square. What is the next smallest value of B with this property?