Algorithms for SU(n) boson realizations and D-functions