Normally when using Dirichlet series, it is used as a generating function to prove certain results like Dirichlet's theorem. I'm wondering whether it's possible to write a function $f(s)$ as a dirichlet expansion $g(s) = \frac{a_1}{1^s} + \frac{a_2}{2^s} + ... \frac{a_n}{n^s}$, such that the $g(s)$ converges to $f(s)$ in some non-zero range. In this way it would be used in a "similar" manner to taylor/fourier series.
Obviously $f(s)$ has to converge to some constant as $s \rightarrow \infty$, but how would one find the coefficients $a_1 ... a_n$?
For example, given $f(s) = \frac{sin(s)}{s} + 1$, I want to find $a_1 ... a_n$ such that $g(s) = f(s)$. In this case, I know $a_1$ = 1, but I'm not sure how to solve for $a_2 ... a_n$.
Another example is that given $f(s) = 2^{-s}$, $a_2 = 1, a_1, a_3 ... a_n = 0$