making a continuous function from a discrete function with steps

46 Views Asked by At

I have a function, that for any non zero positive integer $n$, if you give it $2^n+1$ it produces $2^{(n-1)}$. (I don't know the proper notation to write that in function form.)

For example:

n Input Output
1 3 1
2 5 2
3 9 4
4 17 8

For input in between the discrete input steps it does them iteratively. So if you give it 25, first it does 17 (result 8), then 5 (result 2), then 3 (result 1), and adds the results for a total result of 11.

Example:

Input Steps Output
8 f5+f3 3
25 f17+f5+f3 11
29 f17+f9+f3 13
47 f33+f9+f5 22

I'm curious what this function would look like as a continuous function. When I plot the input/output it's a bumpy curve, so I don't know what kind of formula would capture that. (If there even is one.)

I'm also wondering if the procedure of doing it iteratively is in conflict with simply turning the origin function into a continuous function.

I'm sure it doesn't help that some inputs don't have clear outputs, like 11 would be f9+f2 but there is no function for input 2. Is there a way to extrapolate what they should be?

(It's from this game: https://mergest-kingdom.fandom.com/wiki/Merging )