Skip to content

fyzo98/Collatz-Python_Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Collatz Conjecture Implementation

This Python script implements the Collatz Conjecture, also known as the 3n+1 conjecture. The conjecture states that for any positive integer, the sequence will eventually reach 1.

Functionality

The script contains a function named collatz(number), which takes a positive integer as an argument and prints the Collatz sequence for that number.

The script also contains a loop that prompts the user to input a positive integer. If the input is not a positive integer, the script will print an error message and prompt the user again. If the input is a positive integer, the script will execute the collatz function and break the loop.

How to Run

To run this script, simply execute it in a Python environment. When prompted, input a positive integer to see the Collatz sequence for that number.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages