Rare earth intermediate phases: I. Phases formed with tin and indium