I'm asked to show that for any positive integer n, we have: $S(n)\leq 5\log_2(2n)+7$
Where $S(n)$ is a total function (spans from positive integers to real integers),
such that $S(1) = 7$, and $S(2^k) = S(2^{k-1})+5$
$S(n) \leq 5\log_2(2n)+7$
I'm not exactly sure how to approach this. I'm not sure a proof by induction would be viable here (Don't think that's what the questions wants me to do). And I'm not sure if I can simply just plug in values, and show that positives values for n work in that sense? Any help would be much appreciated.
Let us first determine the sequence for $S(n)=S(2^k)$. By knowing that $S(1)=7$ and $2^0=1$, we can find a way to determine the sequence for $S(n)$ using the recursive sequence $S(2^k)=S(2^{k-1})+5$ for which $k\in\mathbb{Z}$ (note that we are using $k$ right now not $n$):
if $k=1$,
$$\begin{align} S(2^1)=S(2^{1-1})+5 \\ S(2)=S(1)+5 \\ S(2)=7+5 \\ =12.\end{align}$$
From know in that now $S(1)=7$ and $S(2)=12$, we are able to form an arithmetic sequence for $S(n)$. If we continued beyond $n=2$ for $S(n)$, we can see that we get this:
if $k=2$,
$$\begin{align} S(2^2)=S(2^{2-1})+5 \\ S(4)=S(2)+5 \\ S(4)=12+5 \\ =17;\end{align}$$
if $k=3$,
$$\begin{align} S(2^3)=S(2^{3-1})+5 \\ S(8)=S(4)+5 \\ S(8)=17+5 \\ =22;\end{align}$$
if $k=4$,
$$\begin{align} S(2^4)=S(2^{4-1})+5 \\ S(16)=S(8)+5 \\ S(16)=22+5 \\ =27.\end{align}$$
We can now see that the sequence for $S(2^k)$ is in the form of $$n_1,n_2,n_4,n_8,n_{16},\cdots$$ and with the values $$7,12,17,22,27,\cdots.$$
So we can determine a sequence first for $S(2^k)$:
$$d=n_2-n_1=12-7=5$$
$$S(2^k)=n_1+(n-1)d$$ $$S(2^k)=7+(n-1)5$$ $$S(2^k)=5n+2.$$
We can then determine the sequence for $S(n)$ that would make an arithmetic function for $n$ such that since we were using a function of $k$ before this, $n=2^k$:
$$k=\log_2n$$ $$S(\log_2n)=5n+2=S(2^k).$$
To get the pure function for $S(n)$, we must get rid of the "$\log_2$" in the "$S(\log_2n)$" by knowing that the sequence is just transformed:
$$S(\log_2n)=5n+2$$ $$S(n)=5\log_2(n)+2.$$
From this new $S(n)$-equation, we can plug it the inequality and see that it is true for all positive integers $n$:
$$S(n)=5\log_2(n)+2$$ $$\therefore 5\log_2(n)+2\leq5\log_2(2n)+7, \ \forall{n}\in\mathbb{Z}.$$
$\boxed{Q.E.D.}$