I have 6000 shares of stock priced at 1.34/share. I want to how many shares I'll need to purchase at 0.87/share to get an average share price of 1.00/share.
Let's talk a little abstractly. You have $S$ shares bought at $P$ dollars each. Then the value of your portfolio is $SP$.
If you buy another $S'$ shares at $P'$ dollars each, the value of those shares would be $S'P'$
A portfolio with an average price per share of $P_A$ is worth $P_AS_T$ where $S_T$ is the total number of shares.
So you want the sum of your two purchases to equal the average portfolio identified, so that $PS+P'S'=P_AS_T$. Finally, you know that $S_T=S+S'$ since $S_T$ is the total number of shares in your portfolio. Do you see how to use the equation $PS+P'S'=P_A(S+S')$ to answer your question?