设集合A={-1,1,3},B={a+2,a2+4},A∩B={3},则实数a=______.