An archived instance of a Discrete forum

Tracing a Collatz sequence

mark

(10 points)

The Collatz conjecture is one of the most famous unsolved problems in Mathematics. It’s quite easy to state and understand but it has eluded proof for 85 years. Here’s the conjecture:

Given a positive integer a_0, define a sequence (a_i)_{i=0}^{\infty} recursively as follows:
First, a_0 is already chosen. Then, for i>0, let

a_i = \begin{cases} 3 a_{i-1} + 1 & \text{if }a_{i-1} \text{ is odd} \\ a_{i-1}/2 & \text{if }a_{i-1} \text{ is even}. \end{cases}

The conjecture asks if this sequence always lands on the number 1.

Here’s an illustration of the orbit of 3, for example:

You should be able to check these values easily enough.


Your problem

Your assignment is to track the number of operations involved in 5 Collatz steps. To do so, first determine a_0 by summing the positions of the letters in your name. Then respond to this question with

  1. The resulting sequence,
  2. The number of multiplications or divisions required to generate 5 steps in the sequence,
  3. The number of additions required to generate those same 5 steps in the sequence, and
  4. A brief explanation of how you got your results.

If summing the positions of the letters in your name is somehow too much of a chore, here’s a little form that will do it for you:

I won’t write the Collatz code for you but you are free to do so, if you would like!

hzoppoth

86-43-130-65-196-98
division count: 3
multiplication count: 2
addition count: 2

5 steps is pretty short and easy to do on paper. If you add, you also multiply so this number is the same and divisions occur when the step is an even number.

ssatterw

The resulting sequence is 52, 26, 13, 40, 20, 10

There were 5 multiplications/divisions used to perform these 5 steps.

There were 1 additions needed to perform these same 5 steps

I used this program to get these results. Since either division or multiplication is used, the number of these required to complete these steps will be the same as the number of steps. Since addition is only used in the odd case, the number of additions is the same as the number of odd integers.

public static void main(String[] args) {

	Scanner scan = new Scanner(System.in);
	System.out.println("What is the summation of the letters in your name?");
	
	int summation = scan.nextInt();
	
	int even = 0;
	
	int odd = 0;
	
	System.out.println("How many steps would you like to take?\n");
	
	int steps = scan.nextInt();
	
	System.out.printf("The resulting sequence is %d, ", summation);
	
	for(int i = steps; i > 0; i--) {
		if(summation%2 == 0) {
			summation = summation/2;
			if(i != 1) {
				System.out.print(summation + ", ");
			}else {
				System.out.print(summation);
			}
		}else {
			summation = (3 * summation) + 1;
			odd++;
			if(i != 1) {
				System.out.print(summation + ", ");
			}else {
				System.out.print(summation);
			}
			
		}
	}
	System.out.printf("\nThere were %d multiplications/divisions used to perform these 5 steps.\n", steps);
	System.out.printf("There were %d additions needed to perform these same 5 steps\n", odd);
esalzber
  1. My sequence is 73, 220, 110, 55, 166, 83
  2. The number of multiplications and divisions required to generate five steps in this sequence was 5.
  3. The number of additions required to generate five steps in this sequence was 2.
  4. I got these results by writing each step on paper and counting the number of times multiplication, division, and addition were used. Because either multiplication or division is used in each step, I was able to count each step as 1 time multiplication or division was used.
asword

My number was 86
Sequence = 86, 43, 130, 65, 196, 98
I had 3 divisions, 2 multiplications, and 2 additions

We started off at 86, so we needed to do divide that by 2 since its even, the next number was 43, and since that is odd I had to times is by 3 and add one to it. I used that formula to create the other numbers in my sequence

wcshamblin

[56, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1]

Divisions: 14
Multiplications: 5
Additions: 5

I made a quick Python script to get this answer:

seed = 56
path = []
divs = 0
mults = 0
adds = 0

while seed != 1:
    path.append(seed)
    if seed % 2 == 0:
        seed = seed/2
        divs+=1
    else:
        seed = 3*seed+1
        mults+=1
        adds+=1
path.append(1)

print(path,"\n")
print("Divisions: ", divs)
print("Multiplications: ", mults)
print("Additions: ", adds)
jbrandy1

1). 31, 94, 47, 142, 71, 214
2). In the five steps, three of the computations were multiplication and two of the computations were division.
3). In the five steps, three of the computations were addition.
4). My name is Jacob so my seed was 31. 31 is odd so it was multiplied by three and plus one which resulted in 94. 94, being even, was divided by two which resulted in 47. 47 is odd so it went through the odd operation and resulted in 142. 142 being even was halved, which resulted in 71. 71 being odd went through the odd operation and finally resulted in 214.

papplega
  1. 78, 39, 118, 59, 178, 89
  2. There were 2 multiplications and 3 divisions, for a whopping 5 total multiplications or divisions.
  3. There were 3 additions.
  4. To find how many multiplications and additions I did, I counted how many times I started with an odd number. To find how many divisions I did, I counted how many times I started with an even number.
jmille18

83-250-125-376-188-94
division: 3
multiplication + addition: 2

I used my calculator to halve and multiply the numbers. Then I counted the number of times I used multiplication, division, and addition.

asmith42
  1. The full Colatz sequence for my name (Andrew) is as follows: 65, 196, 98, 49, 148, 74, 37, 112, 56, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1.

  2. The number of multiplications required to generate the first 5 steps was 2. The number of divisions required to generate the first 5 steps was 3. In total, there were 5 instances of multiplication or division in the first 5 steps.

  3. The number of additions required to generate those same 5 steps in the sequence was 2.

  4. To calculate the full Colatz sequence, I began by finding the sum of the positions of the letters in my name. That total came to 65, which I then continuously plugged and chugged into the provided equation. I then used my first 5 steps as my set for the following questions. In those first 5 steps, I had 2 odd numbers, meaning the number of times multiplication and addition were performed was 2. I had 3 even numbers in those steps, meaning I had to use division 3 times.

nfourie
  1. The first 5 numbers in the Colatz sequence for my name is, starting with 14(N) + 1(A) + 4(D) + 9(I) + 1(A) = 29 is: 29, 88, 44, 22, 11, 34.

  2. There were 5 total multiplications and divisions in the first 5 steps. Divisions: 3. Multiplications: 2.

  3. Additions: 2.

  4. Since it was only 5 steps, and my name is a pretty low number (29), I could do these steps by hand using a calculator. I wrote down what numbers resulted for each value of i, and kept track of how many multiplications, additions and divisions were performed.

csabb

1. Summing the letters in my name

The sum of the positions of the letters in my name (Chris Sabb) sum up to 81.

2. The resulting sequence

The resulting sequence is: (0) 81, (1) 244, (2) 122, (3) 61, (4) 184, and (5) 92.

3. The number of multiplications or divisions required to generate five steps in the sequence

Two multiplications (81 * 3 + 1 and 61 * 3 + 1) and three divisions (244 ÷ 2, 122 ÷ 2, and 184 ÷ 2) were required to generate these five steps.

4. The number of additions required to generate those same 5 steps in the sequence

Several additions were required to generate these five steps: 243 + 1 from 81 * 3 + 1 and 183 + 1 from 61 * 3 + 1.

jtweeten
  1. Jacob - 31 resulting sequence is— 94, 47, 142, 71, 214

Divison - 2
Multiplication - 3
3.
addition - 3
4.
My name has a seed of 31. Being odd, I multiplied by 3 and added one. Generating 94, being even I divided by 2 to generate 47. Etc.

jnarehoo

71, 214, 107, 322, 161, 484

  • divisions: 2
  • multiplications: 3
  • additions: 3 times

Each time there was an odd number I multiplied then added and for even I divided.

chooke
  1. Sequence: [57, 172, 86, 43, 130, 65]
  2. This took 2 multiplication operations and 3 division operations
  3. Because it took 2 multiplication operations it also took 2 addition operations
  4. I wrote a python script to get my answers
a = 57
seq = [a]
while a > 1:
    if a % 2 == 0:
        a = a / 2
        seq.append(int(a))
    else:
        a = 3 * a + 1
        seq.append(int(a))
print("Sequence: ", seq[0:6])

odds = 0
evens = 0
for i in seq[0:5]:
    if i % 2 == 0:
        evens += 1
    else:
        odds += 1
print("Multiplication and add operations: ", odds)
print("Division operations: ", evens)

output:

Sequence:  [57, 172, 86, 43, 130, 65]
Multiplication and add operations:  2
Division operations:  3
jfennimo
  1. 42-21-64-32-16-8
  2. Multiplications/divisions: 5
  3. Additions: 1
  4. The seed for my name was 42, so this was fairly easy. I simply wrote this out on some notebook paper, starting by dividing 42 in half, then multiplying by 3 and adding 1, then dividing by 2, and again, and again.
gavin

53-160-80-40-20-10
multiplications or divisions: 5
additions: 1
I got these results by writing down the sequence on paper. After getting 160 I could see that the next 4 steps would all be division which made it easy.

tfields

My name is Taylor so my Collatz Sequence is 91. Because i am an idiot and waited 11 days to do this assignment I decided to make a program and do the entire sequence from 91.

The Collatz sequence starting from a0 = 91 is:

91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1

The number of multiplications or divisions required to generate 5 steps in the sequence is 13.
The number of additions required to generate those 5 steps in the sequence is 12.

But the number to do the entire sequence there is 132 additions and 131 multiplications or division.

mark