Collatz Conjecture: A Simple yet Elusive Mathematical Problem

The Collatz Conjecture is a mathematical idea that many people believe to be true, but it remains unproven. It is named after German mathematician Lothar Collatz, who first proposed it in 1937. The conjecture is also known as the “3n + 1” sequence because it is generated by following two simple rules:

  1. If the starting number is even, divide it by 2.
  2. If the starting number is odd, multiply it by 3 and add 1.

The Collatz Conjecture states that regardless of the starting number, the sequence will always reach the number 1. This has been verified for all numbers below 268 using computer calculations. However, despite extensive testing, the conjecture remains unproven, and its status as a conjecture continues to intrigue mathematicians worldwide.

The Collatz Sequence

The Collatz sequence starts with any positive integer and follows the two rules mentioned above. For example, starting with the number 10, the sequence would be:

10 –> 5 –> 8 –> 4 –> 2 –> 1

This sequence is simple yet elusive, as it has properties that are still not fully understood.

Why is the Collatz Conjecture Important?

The Collatz Conjecture is significant because it is a simple problem that has stumped some of the world’s greatest mathematicians for decades. Despite the progress made in understanding the conjecture, it remains one of the most famous unsolved problems in mathematics.

The Search for a Solution

Mathematicians have tried various approaches to solve the Collatz Conjecture, including:

  1. Proving it theoretically using number theory or complex analysis.
  2. Using computer calculations to verify the conjecture for larger numbers.
  3. Exploring the properties of the Collatz sequence and looking for patterns that might lead to a proof.

However, none of these approaches have been successful in proving the Collatz Conjecture. The conjecture remains a mystery, and its resolution continues to be a goal for many mathematicians.

JS/HTML/CSS Code for Creating this Collatz Sequence & Graph Web Page:

<!DOCTYPE html>
<html>
<head>
  <title>Collatz Conjecture</title>
  <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  <style>
    body {
      font-family: Arial, sans-serif;
    }
    #output {
      padding: 10px;
      border: 1px solid #ddd;
      background-color: #f8f8f8;
      font-size: 16px;
    }
    #chart {
      width: 100%;
      height: 500px;
    }
  </style>
</head>
<body>
  <h1>Collatz Conjecture</h1>
  <div id="output"></div>
  <div id="chart"></div>
  <script>
    google.charts.load('current', {'packages':['corechart']});

    function collatz(n) {
      let sequence = [n];
      while (n !== 1) {
        if (n % 2 === 0) {
          n = n / 2;
        } else {
          n = 3 * n + 1;
        }
        sequence.push(n);
      }
      return sequence;
    }

    function generateRandomCollatzAndChart() {
      let n = Math.floor(Math.random() * 100000) + 100;
      let sequence = collatz(n);
      let output = document.getElementById("output");
      output.innerHTML = "Starting number: " + n + "<br>" + sequence.join(", ");

      let data = new google.visualization.DataTable();
      data.addColumn('number', 'Step');
      data.addColumn('number', 'Value');
      for (let i = 0; i < sequence.length; i++) {
        data.addRow([i, sequence[i]]);
      }

      let options = {
        title: 'Collatz Sequence | Start Number: '+n+' | Steps: '+(sequence.length-1),
        curveType: 'function',
        legend: { position: 'bottom' }
      };

      let chart = new google.visualization.LineChart(document.getElementById('chart'));
      chart.draw(data, options);

      // Simulate the sleep function to generate the next sequence after 3 seconds
      setTimeout(generateRandomCollatzAndChart, 3000);
    }

    google.charts.setOnLoadCallback(generateRandomCollatzAndChart);
  </script>
</body>
</html>