• @JPAKx4
    link
    11 year ago

    If you end up doing many numbers, you could create a dictionary, where each number points to the next number in the sequence (ex: [32:16, 16:8, 8:4, 4:2, 2:1], where the first number is the key and the second is the value). If the number already exists in the dictionary, then you know it goes to 1, if it doesn’t then add what you just calculated to the dictionary and then continue.