设A={a,2,4},B={a^2,3,5},且A∩B={4},求a的值