A small java program used to calculate the perseverance of a number