Calculate Initial Velocity For Orbital (Gravity) Slingshot I am trying to find the initial velocity to slingshot a planet around the sun and through a gap. 

The green ball is the planet, and the yellow ball is the sun. In this trial I need to get the planet to go around the sun and through the gap at 278Gm. I have tried different approaches, but nothing seems to be even remotely correct. Anything under 20k m/s will land you in the sun and anything over 50k will slingshot you out of the system. 
I want to know what formula to use so that I can solve this type of problem. 
 A: If you are in a circular orbit what you need is a Hohmann transfer, from Wikipedia:

In orbital mechanics, the Hohmann transfer orbit /ˈhoʊ.mʌn/ is an elliptical orbit used to transfer between two circular orbits of different radii in the same plane.

It works like this assuming the planet is in a circular orbit.

Then the amount of delta v needed to go from the green orbit to the yellow orbit is.

where units are 


*

*$ v \,\!$ is the speed of an orbiting body


*

*$\mu = GM\,\!$ is the standard gravitational parameter of the primary body, assuming $ M+m$ is not significantly bigger than $M$
(which makes  $v_M \ll v$)

*$r \,\!$ is the distance of the orbiting body from the primary focus

*$a \,\!$ is the semi-major axis of the body's orbit.



Using an online calculator I deduce that the delta v you need is 25.07 km/s
This is independent of the mass of the planet.

Ok, let's start over with a different approach, what is the velocity exactly.
Lets just use our trusted elliptical orbits.

Then using equations from this link you can calculate the speed at any point of a eclipse with,
$$ v^2 = \mu\left(\frac{2}{r} - \frac{1}{a}\right) $$
which leads to 44.31 km/s at perihelion.
A: There seem to be three kinds of slingshot manoeuver. You can bleed some kinetic energy off a moving body, sort of like an ancient slingshot; that allows a spacecraft to either increase or decrease its own kinetic energy. Or you can get more "bang for the buck" with the assistance of a gravity well, be it moving or fixed, by expelling mass after having increased your kinetic energy at the expense of gravitational potential energy.
Your case of a planet (which does not lose mass) plus a sun (which can be assumed as stationary, at least so I guess) seems to me to allow neither.
The third kind is to change direction (in 3-D), and only needs a gravity well, but it seems to me you're not interested in that.
But if it's not under propulsion, your planet must be moving on an elliptical orbit, where the sun is one of its foci (sorry; don't know the actual English word). If your values of 100 Gm and 278 Gm are relative to the apsides of its orbit, then you can use the conservation of energy to work out the exact values. You will need to know the masses involved, though.
Your solution will have a slight error due to relativistic considerations.
In the case of a out-of-system planet, it will be moving in a hyperbolic orbit and I don't think there's a way to get to point B from point A (but I may well be mistaken).
