Loops + Mathematical approach