Help needed for alternate proof, & understand proof for any positive integer to be used as a base.
Problem statement:
Let $g$ be a positive integer $\gt 1$. Then every positive $a$ can be written uniquely in the form $$a = c_ng^n+\ldots+c_g+c_0, -(1)$$
where $n\ge 0$, $c_i$ is an integer, $0\le c_i \lt g$, $c_n\ne 0$. $g$ is called the base of $a,$ which is denoted by $(c_nc_{n-1}\ldots c_1c_0)_g$.
Proof: Using induction on $a$. When $a=1$, have $n=0$ & $c_0=1$. So true for $a=1$.
Now assume that the theorem is true for any integer less than $a$. Since $g\gt 1, a\gt 0, a$ must lie between two certain consecutive numbers of the following sequence:
$$g^0,g^1,g^2,\ldots,g^n,\ldots$$
More explicitly, there is a unique integer $n,$ s.t. $$g^n\le a\lt g^{n+1}$$
By divisibility theorem, can state: $$a=c_ng^n+r, 0\le r\lt g^n,$$
obviously, $g\gt c_n \gt 0$. If $r=0$, then $$a=c_ng^n+0g^{n-1}+\ldots +0g+0.$$
If $r\ne 0$, by induction hypothesis $$r=b_tg^t+\ldots+b_g+b_0, t\lt n,$$
where $0\le b_i \lt g.$ Thus $$a=c_ng^n+b_tg^t+\ldots+b_1g+b_0,$$ and the given statement $(1)$ is true.
To prove the uniqueness, assume there is another representation $$a=d_mg^m+\ldots+d_1g+d_0,-(2)$$ with $m\ge 0, 0\le d_i\lt g.$ If $c_i$ & $d_i$ are not all equal, by subtracting $(1)$ from $(2)$, get $$0=e_sg^s+\ldots +e_1g+e_0,$$ where $s$ is the largest value of $i$ for which $c_i\ne d_i,$ so that $e_s\ne 0$. If $s=0$, then $c_1=c_0=0$, which is a contradiction. If $s\gt 0$, $$|e_i|=|c_i-d_i|\lt g-1, i=0,\ldots, s-1,$$ and $$e_sg^s=-(e_{s-1}g^{s-1}+\ldots+e_0),$$ so that $$g^s\lt |e_sg^s|=|e_{s-1}g^{s-1}+\ldots+e_0| \lt (g-1)(g^{s-1}+\ldots+g+1)= g^s -1,$$ which is also a contradiction. Thus conclude $$n=m, c_i=d_i, i=0,1,\ldots,n,$$ as well as the representation is unique.
I feel that the inductive proof is unclear on how it has used the second step (i.e., is true for any value for $n=n'$) of weak-induction to get to the final step.
Also, the proof part for showing uniqueness is inelegant, as per me.
I request an alternate proof (or its source), & have found only one other post on topic on MSE. That post did not address the uniqueness aspect also, although was non-inductive.