The equation of motion of a pendulum is:
[tex]\dfrac{\textrm{d}^2\theta}{\textrm{d}t^2} = -\dfrac{g}{\ell}\sin\theta,[/tex]
where [tex]\ell[/tex] it its length and [tex]g[/tex] is the gravitational acceleration. Notice that the mass is absent from the equation! This is quite hard to solve, but for small angles ([tex]\theta \ll 1[/tex]), we can use:
[tex]\sin\theta \simeq \theta.[/tex]
Additionally, let us define:
[tex]\omega^2\equiv\dfrac{g}{\ell}.[/tex]
We can now write:
[tex]\dfrac{\textrm{d}^2\theta}{\textrm{d}t^2} = -\omega^2\theta.[/tex]
The solution to this differential equation is:
[tex]\theta(t) = A\sin(\omega t + \phi),[/tex]
where [tex]A[/tex] and [tex]\phi[/tex] are constants to be determined using the initial conditions. Notice that they will not have any influence on the period, since it is given simply by:
[tex]T = \dfrac{2\pi}{\omega} = 2\pi\sqrt{\dfrac{g}{\ell}}.[/tex]
This justifies that the period depends only on the pendulum's length.