short lonely integer python implementation