Hey fellow math enthusiasts!
Problem: The number breaking machine only processes natural numbers. Even numbers are halved, odd numbers are reduced by $1$, e.g. $6\to3$; $5\to4$. Now the result is put back into the number crushing machine and this process is continued until the result is $0$, e.g. $5\to4\to2\to1\to0$. Since you reach the goal in four steps with $5$, you call $5$ a “$4$ -step number”.
Result:
The maximum number of each n-step numbers follows the fibonacci list.
e.g.
$1$ $1$-step-number
$1$ $2$-step-number
$2$ $3$-step-numbers
$3$ $4$-step-numbers
$5$ $5$-step-numbers
$8$ $6$-step-numbers
$13$ $7$-step-numbers
...
The problem I'm exploring involves a sequence of numbers where the number of steps it takes to reach zero is connected to Fibonacci numbers. The code I've been using which is based on a variation of the Collatz conjecture has been showing some patterns that seem to align with Fibonacci sequences.
If any of you are familiar with any literature, research papers or articles that discuss problems where the number of steps in a sequence operation is related to Fibonacci numbers I would be incredibly grateful for your insights. Additionally if you have any recommended journals, online resources or books on number theory, sequences or other related mathematical topics that you think could be helpful for me to explore deeper into this relationship. I would greatly appreciate it.
Thank you much in advance for your time and assistance.
C++ code about that problem:
#include <iostream>
#include <vector>
using namespace std;
int myArray[50] = {0};
int calc_steps(int n)
{
int steps = 0;
while (n > 0)
{
if (n % 2 == 0)
{
n /= 2;
}
else
{
n -= 1;
}
steps++;
}
myArray[steps] += 1;
return 0;
}
int main()
{
for (int i = 1; i <= 5000000; ++i)
{
calc_steps(i);
}
for (int i = 0; i < 50; ++i)
{
if (myArray[i] != 0)
{
cout << "There are " << myArray[i] << " " << i << "-step-numbers." << endl;
}
}
return 0;
}
In very short, if you look at your numbers in binary form, the number of steps is the total number of bits (or $\lfloor \log_2(n)\rfloor+1$) + the number of bits set to 1 (or $n-\nu_2(n!)$). So if you multiply a number by 2 (or add a 0 at the end of the binary representation), you add 1 step. If you multiply by 2 and add 1 (or add a 1 at the end of the binary representation), you add 2 steps. You Fibonacci sequence comes from the fact that the n-steps set $F_n$ is build by adding a 0 at the end of the numbers of the $F_{n-1}$ set or a 1 to the numbers of the $F_{n-2}$ set (with $F_0$ and $F_1$ being straightforward)