Solution (source code)

= Solution

Every group element has a unique form $a^rb^s$, with $r\bmod7$ and $s\bmod3$. Conjugation by $b$ doubles the exponent of $a$, giving the two orbits $\{1,2,4\}$ and $\{3,6,5\}$. Conjugation by powers of $a$ runs through all seven elements of each nonidentity coset of $\langle a\rangle$. The classes are therefore
$$
\boxed{\{1\},\quad\{a,a^2,a^4\},\quad\{a^3,a^5,a^6\},\quad\{a^rb:0\leq r<7\},\quad\{a^rb^2:0\leq r<7\}.}
$$
Their sizes $1,3,3,7,7$ sum to twenty-one.