Solution
= Solution
Let the full cube mass be $M=8\rho a^3$ and the removed cylinder mass $m_h=2\pi\rho ar^2$. About the rod, the remaining moment is
$$
I=M a^2(2/3+\gamma^2)-\tfrac12m_hr^2.
$$
The remaining centre-of-mass distance $\ell$ obeys $(M-m_h)\ell=M\gamma a$, so the small-angle equation is $I\ddot\theta+M g\gamma a\,\theta=0$. Hence
$$
\boxed{T=2\pi\sqrt{\frac a{g\gamma}\left(\frac23+\gamma^2-\frac\pi8\frac{r^4}{a^4}\right)}.}
$$