The main motivation of this paper was to give finite and infinite generating functions for the numbers of the k-ary Lyndon words and necklaces. In order to construct our new generating functions, we use two different methods. The first method is related to the derivative operator t d/dt and the Stirling numbers of the second kind. On the other hand, the second method is related to the Hurwitz-Lerch zeta function and the Apostol-Bernoulli numbers. Moreover, by using these generating functions, we give some applications for some selected numerical values including different prime numbers factorization, the Stirling numbers and also the Bernoulli numbers and polynomials.