What we are looking for is the Taylor series at $z=\pi/2$ for $g(z)$. The Taylor series is defined as
$$
f(z) = \sum_{n=0}^{\infty}\frac{f^{(n)}(a)}{n!}(z-a)^n
$$
Therefore, for $g(z)$, we have
\begin{align}
g(z) &= g(\pi/2) + g'(\pi/2)(z - \pi/2) + \frac{g''(\pi/2)}{2!}(z - \pi/2)^2 + \cdots\\
&= 1 + (z - \pi/2) + \frac{1}{2!}(z - \pi/2)^2 + \frac{2}{3!}(z - \pi/2)^2 + \cdots\\
&= \sum_{n=0}^{\infty}\frac{(z - \pi/2)^n}{n!}U_{n + 1}
\end{align}
where $U_n$ are the up down numbers. You only need the first four to figure out you need up down numbers. I checked the next 3 terms as well to verify. As a note, the up down numbers are
$$
1,1,1,2,5,16,61,272,1385,\text{look up rest}
$$
In your series above, we start at $U_{n + 1}$ for $n\geq 0$.
At $z = 0$, we get $g(0) = 0$, $g'(0) = 1/2$, etc. so we yield the Taylor series for $g(z)$ at $z = 0$.
Edit: After clarifying in chat, it seems there are two questions here regarding finding power series solutions to second order, linear ODE.
- Will the two solutions I get always be linearly independent?
- After I've found two solutions, how can I check whether or not they are linearly independent?
Answer to Question 1:
When using the Method of Frobenius to obtain a power series solution of a second order linear ODE in the neighborhood of a regular singular point, in can happen that you end up finding only one linearly independent power series solution. (You do find two solutions, but the second is a constant multiple of the first.)
This happens when solving Bessel's equation
$$
x^2y''(x)+xy'(x)+(x^2-\mu^2)y(x)=0
$$
about $x=0$. It is a long and tedious calculation, too long to type out, but you can study it here in Example 5.7.2 starting on page 345.
However, you can always fall back on the method you alluded to above, often called reduction of order/variation of constants, to find a second linearly independent solution $y_2$ once you have any one solution $y_1$. That applies the Bessel's equation as well.
Answer to Question 2:
Typically we would compute the Wronskian of $y_1$ and $y_2$, $W(y_1(x),y_2(x))(x)$ and appeal to the fact that $y_1$ and $y_2$ are linearly independent iff the Wronskian in nonzero. When $y_1$ and $y_2$ are power series this looks to be a cumbersome calculation. However, let's appeal to the full power of the Wronskian statement regarding linear independence:
If $W(y_1,y_2)(x_0)\not=0$ for some $x_0\in I$, then $y_1(x)$ and
$y_2(x)$ are linearly independent on $I$.
Case 1: Ordinary points
Now just pick $x_0$ judiciously: say, $x_0$ is the ordinary point about which we found the two series solutions
$$
y_1(x)=\sum_{n=0}^\infty a_n(x-x_0)^n, \quad y_2(x)=\sum_{n=0}^\infty b_n(x-x_0)^n,
$$
Then
$$
W(y_1,y_2)(x_0)=y_1(x_0)y_2'(x_0)-y_2(x_0)y_1'(x_0)=a_0b_1-b_0a_1
$$
tells the tale (whether this is zero or not).
Case 2: (Regular) singular points
This takes quite a bit of typing. I will punt by pointing you here, page 14. If someone has a better "preserved" source than this and/or wants to edit my answer to give the full details in this case, please do.
Best Answer
That depends upon how much you know about the equality$$\log(1-z)=-\sum_{k=1}^\infty\frac{z^k}k.\tag1$$If it turns out that you know that it holds whenever $|z|<1$ and $z\ne1$, then, yes, you can put $z=-1$. If you only know that $(1)$ holds when $|z|<1$, you can use the fact that$$\log(2)=-\log\left(\frac12\right)=-\log\left(1-\frac12\right)=\sum_{k=1}^\infty\frac1{k2^k}.$$