In a search I found some information where I verified a certain linearity in the data, to certify what I was seeing, I put 5,000 points of this data, in the form {X, Y}, in a graph ( https://plot.ly/create/?fid=bencz:1 )
What $ f(x) $ can be used to describe this graph?
Since you've only provided us with data, I will construct a formula based on the patterns alone. Since it's hard to check all 5000 values to verify my formula, please let me know if I miss something.
Notice $f(0)=0,\ f(10)=3,\ f(20)=6,\dots, f(10n)=3n$
Now, notice that $f(1)=2,\ f(11)=5,\ f(21)=8,\dots, f(10n+1)=2+3n$
Similarly, notice that for any natural number $k<10$, we have $f(10n+k)=3n+2k$
Now, observe that $f(100)=4$, $f(1000)=5, \dots f(10^m)=(m\mod 6)+2$ (It looks like it's simply $m+2$, but in the OP's code presented below, the multiplier is reset to $2$ whenever it gets passed $7$. So we must account for that here.)
It appears that your function takes the number $x$ to the base $10$, multiplies the $10^m$'s digit by $(m\mod 6)+2$, and takes the sum. So far, if $g(x,n)$ is the $n$th digit of $x$ to the base $10$, we have $$f(x)=\sum_{i=0}^\infty ((i\mod 6)+2)g(x, i) $$
One closed form of $g(x,n)$ is $$g(x,n)=\left\lfloor\frac{x}{10^{n}}\right\rfloor \mod 10$$
So in total we have: $$f(x)=\sum_{i=0}^\infty ((i\mod 6)+2)\left( \left\lfloor\frac{x}{10^i}\right\rfloor \mod 10\right)$$