A formula for the *-core of an ideal