<s>[INST] How many ways are there to use powers of $2$, each at most $3$ times, and sum up to $100$? 
For $i=0,1,2,\ldots$, there're $3$ weights with mass $2^i$ gram(s). How many ways are there to weigh $100$ grams with them?

To solve with normal methods for counting doesn't seem possible. Although any way to select weights can be generated by starting from $100=2^6+2^5+2^2$ and replacing $2^{k+1}$ with $2^k+2^k$ numerous times, whether a replacement like that can take place depends on other replacements already made. For example, if there're already $2$ weights with mass $2^3$ used, you cannot replace $2^4$ with $2^3+2^3$ any more.
On the other hand, generating functions may help. I constructed the following function:$$\begin{aligned}f(x)=&\prod_{t=0}^6\left(1+x^{2^i}+x^{2\times2^i}+x^{3\times2^i}\right)\\=&(1+x+x^2+x^3)(1+x^2+x^4+x^6)\cdots(1+x^{64}+x^{128}+x^{192}).
\end{aligned}$$and we need to find the coeffitient of term $x^{100}$. How to compute this?
$\tiny\text{Why isn't there a tag for enumeration problems?}$
 [/INST] Your generating function $f(x)$ might as well be infinite:
$$\prod_{n=0}^{\infty}\left(1+x^{2^n}+x^{2(2^n)}+x^{3(2^n)}\right)$$
Now split this over even $n$ and odd $n$:
$$\prod_{n=0}^{\infty}\left(1+x^{4^n}+x^{2(4^n)}+x^{3(4^n)}\right)\prod_{n=0}^{\infty}\left(1+x^{2(4^n)}+x^{4(4^n)}+x^{6(4^n)}\right)$$
The left product is $\left(1+x+x^2+x^3\right)\left(1+x^4+x^8+x^{12}\right)\left(1+x^{16}+x^{32}+x^{48}\right)\cdots$. This is a factorization of $\left(1+x+x^2+x^3+\cdots\right)$.
Similarly the right product is $\left(1+x^2+x^4+x^6\right)\left(1+x^8+x^{16}+x^{24}\right)\left(1+x^{32}+x^{64}+x^{96}\right)\cdots$ and this is a factorization of $\left(1+x^2+x^4+x^6+\cdots\right)$.
So the generating function is
$$\left(1+x+x^2+x^3+\cdots\right)\left(1+x^2+x^4+x^6+\cdots\right)$$
Now you can see when this is multiplied out, what is the coefficient of $x^m$. If $m$ is even, you have $1\cdot x^m+x^2\cdot x^{m-2}+\cdots+x^m\cdot1=\frac{m+2}{2}x^m$.
If $m$ is odd, you have $x\cdot x^{m-1}+x^3\cdot x^{m-3}+\cdots +x^m\cdot1=\frac{m+1}{2}x^m$.
In the case of $m=100$, the coefficient is $\frac{102}{2}=51$.

Note that a new interpretation of the generating function $\left(1+x+x^2+x^3+\cdots\right)\left(1+x^2+x^4+x^6+\cdots\right)$ is that you can use $0$ or more $1$-weights, and $0$ or more $2$-weights. What is the combinatorial connection between that interpretation and the original description?
</s>