Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribedwith 1.

image text in transcribedimage text in transcribedimage text in transcribed

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 17 kform action="Collatz" method="POST">

Collatz Conjecture

/ 44 Collatz Conjecture Please enter a number from 5 to 20,000: Calculate

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions