Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

For Hailstone numbers, what is the maximum number of iterations to reach the cycle (4, 2, 1....) and which number produces this max?

I had to make a program that gives this information and I want to check if the program is giving me the correct or incorrect values. I am getting the number 171 that produces 124 cycles.

Update:

For integers between 1 and 200

2 Answers

Relevance
  • carris
    Lv 4
    4 years ago

    Hailstone Numbers

  • ?
    Lv 7
    6 years ago

    I'm a little slow to answer this, because I didn't know the sequence as "Hailstone numbers"; I learned about them from Douglas Hofstadter's column in which he referred to the function as the

    "half or triple plus one" function.

    [He then abbreviated it hotpo(), and named its argument "tato," standing for "tato and tato ONLY." This allowed him to write code in the form

    hotpo(tato)

    of course!]

    Anyhow, if you think a bit, I believe you'll recognize that there IS no maximum number of iterations, because for any number N that would produce such a suspected maximum, there is the sequence

    N, 2N, 4N, 8N, ...

    each of which produces one more iteration than the one which precedes it in the sequence.

Still have questions? Get your answers by asking now.