The line of succession only applies to situations where individual A is unavailable, so individual B assumes the mantle. If individual B is unavailable, the individual C takes the mantle, etc.
Our current situation would play out like this:
Trump goes away, Pence gets sworn in as #46.
It is (nearly) his first act to identify a new VP.
The House and Senate have to approve of the new VP choice. If both approve then the new VP is sworn in.
Pelosi remains in the third place in the line of succession.
Fun politics to consider:
As long as there is no sworn-in VP then Pelosi is, effectively, second-in-line for the presidency. Thus, the House Democrats have a strong politics reason not to approve of any nominee. Likewise, the Senate has a strong politics reason not to approve any nominee that is so liberal that the House would approve him/her (since, as noted, any nominee that would be acceptable to Pence and the Republicans would very likely not be as acceptable to the Democrats as Pelosi).
All of which is to say - it's very possible if impeachment and conviction happen (a first in American history) that we descend into a true constitutional crisis. Good times.