• fortran code

    From Mantu Sah@21:1/5 to All on Tue Sep 13 23:44:28 2022
    The 3n+1 problem/ Collatz Conjecture. Take a positive integer n, if its odd do 3n+1, otherwise in case of even divide it by 2. Perform this repeatedly and verify the number of sequence always reaches to 4->2->1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Koenig@21:1/5 to Mantu Sah on Wed Sep 14 14:07:24 2022
    Mantu Sah <mn2iacs@gmail.com> schrieb:

    The 3n+1 problem/ Collatz Conjecture. Take a positive integer
    n, if its odd do 3n+1, otherwise in case of even divide it by
    2. Perform this repeatedly and verify the number of sequence always
    reaches to 4->2->1

    That code is straightforward to write (but you have to watch for
    overflow). It is also a question if (3*n+1)/2 should be called
    a single step.

    Or are you asking us to write it for you?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)