So I'm not really sure how to phrase this question so i apologize in advance.
I am trying to find a function that matches the image below. I generated this image by iterating through hole numbers between 1 and 100. Then I counted how many divisions of 2 it could do until it would reach an odd number (The y axis number of divisions).
So my question is, is there any function that matches this graph at the points not necessarily the lines? (I am thinking some kind of trick with modular)

Well, if I understand you question correctly, this is just the number of 2's in factorisation of given number... E.g. $52=2^2*13$, so you can divide by 2 two times, $24=2^3*3$, so you can divide three times etc.
Anyway, if you want you may define $until$ recursively:
$until ( property(x),\ step(x),\ x_{starting}) = \\ -\ if\ property(x_{starting})\ then\ x\\ -\ otherwise\ until ( property(x),\ step(x),\ step(x_{starting}))$