First time here? Check out the FAQ!
answered 7 years ago
A compact version of the mentioned related question is:
def f( myList ): return myList[1] * myList[-1] len( [ T for T in graphs.trees( 18 ) if T.diameter() == 5 and f( sorted( T.laplacian_matrix().eigenvalues() ) ) == 1 ] )
Enjoy!