User blog comment:Wythagoras/Friendship function/@comment-1605058-20140717204945/@comment-1605058-20140718122840

As an example of what I meant, try to work out how many vertices has graph with following bracketing: (q,p,p)(q,q)(q,p)(q,p)(q,o)(q,o)(p,p). It's not hard, but in no way obvious.