Collatz Sequence Please create a C-program with the use of looping statements and conditional statements. Please do NOT use pointers, please! :) The Collatz conjecture is a conjecture in mathematics named after Lothar Collatz, who first proposed it in 1937. The conjecture is also known as the 3n + 1 conjecture, the Ulam conjecture (after Stanisław Ulam), Kakutani’s problem (after Shizuo Kakutani), the Thwaites conjecture (after Bryan Thwaites), Hasse’s algorithm (after Helmut Hasse), or the Syracuse problem; the sequence of numbers involved is referred to as the hailstone sequence or hailstone numbers (because the values are usually subject to multiple descents and ascents like hailstones in a cloud), or as wondrous numbers. Mathematics The Collatz function is defined for a positive integer n as follows. f(n) = 3n+1 if n is odd n/2 if n is even We consider the repeated application of the Collatz function starting with a given integer n, as follows: f(n), f(f(n)), f(f(f(n))), … It is conjectured that no matter which positive integer n you start from, this sequence eventually will have 1 in it. It has been verified to hold for numbers up to 5 × 260 [Wikipedia: Collatz Conjecture]. If n=7, the sequence is f(7) = 22 f(f(7)) = f(22) = 11 f(11) = 34 f(34) = 17 f(17) = 52 f(52) = 26 f(26) = 13 f(13) = 40 f(40) = 20 f(20) = 10 f(10) = 5 f(5) = 16 f(16) = 8 f(8) = 4 f(4) = 2 f(2) = 1 Thus if you start from n=7, you need to apply f 16 times in order to first get 1. In this question, you will be given a positive number
Collatz Sequence Please create a C-program with the use of looping statements and conditional statements. Please do NOT use pointers, please! :) The Collatz conjecture is a conjecture in mathematics named after Lothar Collatz, who first proposed it in 1937. The conjecture is also known as the 3n + 1 conjecture, the Ulam conjecture (after Stanisław Ulam), Kakutani’s problem (after Shizuo Kakutani), the Thwaites conjecture (after Bryan Thwaites), Hasse’s algorithm (after Helmut Hasse), or the Syracuse problem; the sequence of numbers involved is referred to as the hailstone sequence or hailstone numbers (because the values are usually subject to multiple descents and ascents like hailstones in a cloud), or as wondrous numbers. Mathematics The Collatz function is defined for a positive integer n as follows. f(n) = 3n+1 if n is odd n/2 if n is even We consider the repeated application of the Collatz function starting with a given integer n, as follows: f(n), f(f(n)), f(f(f(n))), … It is conjectured that no matter which positive integer n you start from, this sequence eventually will have 1 in it. It has been verified to hold for numbers up to 5 × 260 [Wikipedia: Collatz Conjecture]. If n=7, the sequence is f(7) = 22 f(f(7)) = f(22) = 11 f(11) = 34 f(34) = 17 f(17) = 52 f(52) = 26 f(26) = 13 f(13) = 40 f(40) = 20 f(20) = 10 f(10) = 5 f(5) = 16 f(16) = 8 f(8) = 4 f(4) = 2 f(2) = 1 Thus if you start from n=7, you need to apply f 16 times in order to first get 1. In this question, you will be given a positive number
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
100%
Collatz Sequence
Please create a C-program with the use of looping statements and conditional statements. Please do NOT use pointers, please! :)
The Collatz conjecture is a conjecture in mathematics named after Lothar Collatz, who first proposed it in 1937. The conjecture is also known as the 3n + 1 conjecture, the Ulam conjecture (after Stanisław Ulam), Kakutani’s problem (after Shizuo Kakutani), the Thwaites conjecture (after Bryan Thwaites), Hasse’s algorithm (after Helmut Hasse), or the Syracuse problem; the sequence of numbers involved is referred to as the hailstone sequence or hailstone numbers (because the values are usually subject to multiple descents and ascents like hailstones in a cloud), or as wondrous numbers.
Mathematics
The Collatz function is defined for a positive integer n as follows.
f(n) = 3n+1 if n is odd
n/2 if n is even
We consider the repeated application of the Collatz function starting with a given integer n, as follows:
f(n), f(f(n)), f(f(f(n))), …
It is conjectured that no matter which positive integer n you start from, this sequence eventually will have 1 in it. It has been verified to hold for numbers up to 5 × 260 [Wikipedia: Collatz Conjecture].
If n=7, the sequence is
f(7) = 22
f(f(7)) = f(22) = 11
f(11) = 34
f(34) = 17
f(17) = 52
f(52) = 26
f(26) = 13
f(13) = 40
f(40) = 20
f(20) = 10
f(10) = 5
f(5) = 16
f(16) = 8
f(8) = 4
f(4) = 2
f(2) = 1
Thus if you start from n=7, you need to apply f 16 times in order to first get 1.
In this question, you will be given a positive number
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY