Relationship between digits in a number