expecting 536870912 to be a square is plain wrong.
I have not accessed the solution yet, but I gues its quite easy with A2-1 = (A-1)(A+1). You shuould be careful to make everyting unsigned int and thats abut it.
Wrong test case 536870912, no square ends in a 2
The Problem tests not only squares. You need to check every possible power. It is indeed 2^29