Modified Fair and Square to use a mathematically formula to detect fair numbers, instead of using string manipulation for this