The memory function of an impurity with different mass and Hooke constant in a classical diatomic chain is studied by means of the recurrence relations method. The Laplace transform of the memory function has two pairs of resonant poles and three branch cuts. The poles contribute a cosine and the cuts contribute acoustic and optic branches, which are expressed as a convolution of a difference of two sines and an expansion of even-order Bessel functions. The expansion coefficients are integrals of Jacobian elliptic function sn(u) along the real axis in a complex u+iv plane for the acoustic branch, and integrals of nd(v) along a contour parallel to the imaginary axis of the plane for the optical branch, respectively. Different special cases are discussed in detail. It shows that a perfect monatomic or diatomic chain and such a chain with a mass impurity share the same memory function except for a constant factor, and that the pole contribution exists only if the impurity has both different mass and Hooke constant.