Let A(2t,3,−1) and B(4,−1,t) be the endpoints of a diameter of a sphere that passes through the point P(3,1,1), where t is a real parameter.
a. (i) Determine the value(s) of t for which P lies on the sphere.
b. (ii) For each admissible value of t, write the corresponding equation of the sphere.