>>Muzzle velocity squared, multiplied by the weight of the pellet, divided by 450240

Spot on. Looks a bit weird but it's because of the units used - grains, pounds, and feet.

The kinetic energy of a pellet leaving the barrel is:

(pellet weight x (speed x speed)) / 2

This is nice and easy using SI units:

(Kg x (m/s x m/s)) / 2

i.e. (pellet weight in grams / 1000 x (speed in metres/second x speed in metres/second)) / 2

The result is the energy in joules.

It gets a bit messy in imperial because grains isn't a simple fraction of a pound. But the figure of 450240 is a simple way to convert grains to pounds and also apply the division by 2 in the formula. So, you put in feet/second and grains and out pops the energy in lb/ft.