In this paper we generalize some former results of Das et al. about distances with n-dimensional periodic neighbourhood sequences. We use a more general definition of neighbourhood sequences, which does not require periodicity. As an extension of the earlier results, we give a formula to calculate the distance between two arbitrary points with general neighbourhood sequences in an arbitrary finite dimension. Moreover we extend the result to the infinite-dimensional digital space.