Question
Hi so this is a php program that im working on. Its about something called a Collatz Conjecture. Im able to figure out how to
Hi so this is a php program that im working on. Its about something called a Collatz Conjecture. Im able to figure out how to get the front page were the user can put in a number for it to calculate. But i fall flat on how to get the end part were it calculates the actual number. Iv research some peoples way of coding it but the only stuff i could ever find is stuff that works on cpp and when i try to put it on here it just comes with a lot of problems that i don't even understand how to fix. Help would be really great with this
What is the Collatz Conjecture: Collatz conjecture: successive operations on a number as dividing it by 2 if it is even and else multiply it by 3 and add 1. The conjecture says that the sequence ends with 1.
Testing Collatz The conjecture uses the following algorithm: If the number is even, divide it by 2, otherwise multiply by 3 and add 1. Repeat. Can you find a starting number that doesn't get stuck at 1? ie. n = 11 RESULTS: #1: 34 #2:17 #3: 52 #4: 26 #5: 13 # ie. n = 320 RESULTS: #1: 160 2: 80 ie n = 13 RESULTS: #1: 40 #2: 20 #3:10 #4: 5 #5: 16 ien=640 RESULTS: #1: 320 #2: 160 #3: 80 #4: 40 #5 # # 3:40 # # #6: #6: 40 # O # #7: # #8: 16 # #9: 8 #7: 20 #8: 10 #9: 5 #10: 16 #11: 8 #12: 4 #13: 2 #14: 1 #10: 2 #11:1 #10: 4 #11: 2 #12: 1
Collatz Conjecture
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started