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?}$
 A: 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?
A: There's a reasonably efficient method of  calculating the number of ways of obtaining a given total from a finite collection of weights using a two-dimensional recursion.  Let $\ a_1<$$\,a_2<$$\,\dots<$$\,a_s\ $ be the possible weights $(1$, $2$, $4$, $8$, $16$, $32$ and $64$ in your case), and $\ n_i\ $ be the number of copies of weight $\ a_i\ $ available $(\ n_i=3$ for all $\ i\ $ in your case).
For $\ i=1,$$\,2,$$\,\dots,$$\,s\ $ and $\ t=0,$$\,1,$$\,\dots$$\,T\ $, let $\ w(i,t)\ $ be the number of ways of obtaining the total $\ t\ $ using only the weights of values $\ a_1,$$\,a_2,$$\,\dots,$$\,a_i\ $, and, for $\ k=0,$$\,2,$$\,\dots,$$\,n_i\ $, $\ w_e(i,t,k)\ $ the number of ways of obtaining the total $\ t\ $ using only the weights of values $\ a_1,$$\,a_2,$$\,\dots,$$\,a_{i-1}\ $, and exactly $\ k\ $ of the weights of value $\ a_i\ $. Then
\begin{align}
w(1,t)&=\cases{1&if $\ a_1\mid t\ \text{ and }\ \frac{t}{a_1}\le n_1$\\
0&otherwise}\\
w_e(i,t,0)&=w(i-1,t)\\
w_e(i,t,k)&=w_e(i,t-a_i,k-1)\ \text{ for }\ t\ge a_i\ \text{ and } k\ge1\\
w(i,t)&=\sum_{k=0}^{n_i}w_e(i,t,k)\ .
\end{align}
Below is a Magma script which computes $\ w(6,100)\ $  from this recursion for your case.  You can run it by copying and pasting it into the online Magma calculator. Its answer and $2$'$5$ $9$'$2$'s provide mutual confirmation of each other—namely,that the total number of ways is $51$.
T:=100;
a:=[1,2,4,8,16,32,64];
n:=[3,3,3,3,3,3,3];
w:=ZeroMatrix(IntegerRing(), #a, T+1);
for x in [0..Min(Floor(T/a[1]),n[1])] do
  w[1,x*a[1]+1]:=1;
end for;

for i in [2..#a] do
we:=ZeroMatrix(IntegerRing(),T+1, n[i]+1);
for t in [0..T] do
  we[t+1,1]:=w[i-1,t+1];
end for;
for k in [1..n[i]] do
  for t in [a[i]..T] do
    we[t+1,k+1]:=we[t+1-a[i],k];
  end for;
end for;
for t in [0..T] do
  for k in [0..n[i]] do
    w[i,t+1]:=w[i,t+1]+we[t+1,k+1];
  end for;
end for;
end for;
print w[#a,T+1];

Addendum
If you replace the first three lines of the above script with
T:=2022;
a:=[1,2,4,8,16,32,64,128,256,512,1024];
n:=[3,3,3,3,3,3,3,3,3,3,3];

it will also give the same answer of $1012$ as $2$'$5$ $9$'$2$'s method for the total $2022$.
A: This answer was inspired by my first answer that used the generating function, but this answer doesn't use generating functions.
Suppose $n_02^0+n_12^1+n_22^2+\cdots+n_k2^k=M$ (where $M$ can be $100$) with each $n_i\in\{0,1,2,3\}$. Then split up the even and odd powers, and for appropriate $i$ and $j$:
$$
\begin{align}
M
&=\left(n_02^0+n_22^2+n_42^4+\cdots+n_{2i}2^{2i}\right)+\left(n_12^1+n_32^3+n_52^5+\cdots+n_{2j+1}2^{2j+1}\right)\\
&=\left(n_0+n_24+n_44^2+\cdots+n_{2i}4^i\right)+2\left(n_1+n_34+n_54^2+\cdots+n_{2j}4^j\right)
\end{align}$$
So $M=(n_{2i}\cdots n_2n_0)+2(n_{2j}\cdots n_3 n_1)$ where the integers here are written in base $4$. So we've written $M$ as a sum of an even number with some other number (using base $4$). And this is reversible: write $M=a+2b$ and you can recover $M$ as a unique sum of the weights of size $2^i$.
So the answer to the OP is the same as how many non-negative even integers ($2b$) are less than or equal to $M$. If $M$ is even, this is $\frac{M+2}{2}$. If $M$ is odd, $\frac{M+1}{2}$. In the case of $M=100$, it's $51$.
