In Fundamentals of Complex Analysis Engineering, Science, and Mathematics by Saff and Snider, problem 2.5.13 is
Find a function harmonic inside the wedge bounded by the nonegative $x$-axis and the half-line $y = x \ \ (x \ge 0)$ that goes to zero on these sides but is not identically zero. [HINT: See Prob. 12.]
And problem 12 is
Prove that if $r$ and $\theta$ are polar coordinates, then the functions $r^n \cos n\theta$ and $r^n \sin n\theta$, where $n$ is an integer, are harmonic as functions of $x$ and $y$. [HINT: Recall De Moivre's formula.]
I know that $r^n\cos n \theta = \Re \{[re^{i\theta}]^n\}=\Re z^n$, and I think since $z^n$ is analytic in this domain then its components are harmonic.
What I don't see is how to relate this to problem 13. I know that one solution to this problem is $z^4$ but I don't see how this comes from these facts about polar coordinates. So although I know a solution to problem 13, I'm not sure how one is supposed to find it by the hint. I guess somehow we're setting $n=4$, but why? Is $\theta = \pi/4$ and $\theta=0$ to get the two rays from the origin? Even if I can guess at superficial connections I can't begin to see the rigorous logic connecting these.
Indeed, you are looking for $n$ such that $\sin(n\pi/4)=0$, so $n=4$ will do. Take $f(r,\theta)=r^4 \sin(4\theta)$.