About 159,000 results
Open links in new tab
  1. Making a collatz program automate the boring stuff

    I'm trying to write a Collatz program using the guidelines from a project found at the end of chapter 3 of Automate the Boring Stuff with Python. I'm using python 3.4.0. Following is the …

  2. Project Euler Question 14 (Collatz Problem) - Stack Overflow

    Apr 15, 2010 · Project Euler Question 14 (Collatz Problem) Asked 15 years, 8 months ago Modified 9 years, 7 months ago Viewed 18k times

  3. python - Collatz conjecture sequence - Stack Overflow

    The Collatz conjecture what i am trying to do: Write a function called collatz_sequence that takes a starting integer and returns the sequence of integers, including the starting point, for that nu...

  4. python - Why does the while loop only runs once when I use the …

    This is The Collatz Sequence Enter a number: 3 3 [10, 5, 16, 8, 4, 2, 1] Yield is logically similar to a return but the function is not terminated until a defined return or the end of the function is …

  5. Collatz Conjecture Method - Java - Stack Overflow

    I am just learning to use methods in Java. I am trying to use a method to output the number of steps it takes to get to 1 using the collatz conjecture. Can anyone help me understand better …

  6. python - Project Euler 14 code efficiency - Stack Overflow

    13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz …

  7. Automate the boring stuff with Python - The Collatz Sequence

    Jun 9, 2023 · The Collatz Sequence Write a function named collatz() that has one parameter named number. If number is even, then collatz() should print number // 2 and return this value. …

  8. What is the problem with my code Longest Collatz Sequence?

    What is the problem with my code Longest Collatz Sequence? Asked 5 years, 8 months ago Modified 3 years, 10 months ago Viewed 2k times

  9. Longest Collatz Sequence - Prokect Euler #14 - Stack Overflow

    Feb 14, 2016 · Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1. Which starting number, under one million, produces the longest chain?

  10. math - Collatz Conjecture in Python - Stack Overflow

    Oct 1, 2017 · I'm relatively new to Python and I decided to try and code a relatively simple collatz conjecture where the user enters a number (integer). The code is just a simple function that …