$\gcd\left(\lfloor x+1\rfloor+1,2^{\lfloor x\rfloor}+1\right)$ has a similar structure to the Sierpinski's triangle. Is it a fractal?

131 Views Asked by At

Working on a deleted question, I found a similar structure to the Sierpinski's triangle this is:

$$\gcd\left(\lfloor x+1\rfloor+1,2^{\lfloor x\rfloor}+1\right)$$

triangle

Is it a fractal? Does it have nice properties as it could be related to prime number?

1

There are 1 best solutions below

6
On BEST ANSWER

Sadly, it seems like Desmos (if it is indeed desmos you used), lied to you.

To clearly expose it, let's define $f : n \mapsto \gcd(n + 2, 2^n + 1)$, which is the function you plotted on the image.

If we take the highest point on the image, (namely at $n=190$), Desmos indeed says that we have $f(190) = 64$, but the truth is that $f(190) = 1$. Indeed, $190 + 2 = 192 = 2^6 \cdot 3$, and it is obvious that $2^6$ does not divide $2^{190} + 1$, neither does $3$, as can be found with some modular arithmetic.

So Desmos is most likely giving false results because of overflows, and to be fair, the same 'fractal' seems to be here for most plots of the form $\gcd(an + b, 2^n +1)$ for $a, b \in \mathbb N$. (You can test that for yourself).


I plotted the correct results with matplotlib, and sadly it seems like the pattern disappeared.

Image plot for values from 1 to 100 000