I have been working on the Collatz problem for a while now, and have made this efficient cobweb plot function for it, where it automatically does all the dividing by two and always returns an odd number to be input back into it: $$ C\left(x\right)=\frac{x\cos^{2}\left(\frac{\pi x}{2}\right)}{2^{\left(\sum_{m=1}^{\infty}\left(m\sin^{2}\left(\frac{\pi}{2^{m+1}}x\right)\prod_{l=0}^{m-1}\left(\cos^{2}\left(\frac{\pi}{2^{m-l}}x\right)\right)\right)\right)}}+\sum_{k=1}^{\infty}\left(\frac{3x+1}{2^{k}}\cos^{2}\left(\frac{\pi x}{2^{k+1}}-\left(-1\right)^{k}\frac{\left(2^{k}-\left(-1\right)^{k}\right)\pi}{3\cdot2^{k+1}}\right)\prod_{n=1}^{k}\left(\sin^{2}\left(\frac{\pi x}{2^{n}}+\left(-1\right)^{n}\frac{\left(2^{n-1}-\left(-1\right)^{n-1}\right)\pi}{3\cdot2^{n}}\right)\right)\right) $$
The spot where the Jacobsthal numbers show is in the second sine and cosine functions, where $\frac{\left(2^{k}-\left(-1\right)^{k}\right)\pi}{3\cdot2^{k+1}}$ can be rearranged into $\frac{2^{k}- (-1)^{k}}{3} \cdot \frac{\pi}{2^{k+1}}$ and $\frac{2^{n-1}- (-1)^{n-1}}{3} \cdot \frac{\pi}{2^{k+1}}$ can be found in $\frac{\left(2^{n-1}-\left(-1\right)^{n-1}\right)\pi}{3\cdot2^{n}}$. Those two functions when $\frac{\pi}{2^{k+1}}$ is taken out can calculate the Jacobsthal numbers, with the latter being one step behind form the former.
Now my question. I found out that the Jacobsthal numbers occurred in this by sheer brute force, doing enough to get a few numbers and sticking them in the OEIS, showing me the working sequence of A001045. Because I did this the brute force way, I don't understand why they work, just that they do work, and I would really appreciate if someone could see and explain why they show up.
Desmos graph: https://www.desmos.com/calculator/1fkdrnwm3e