Calculate the number of topologies on {1,2,...,n}
Python, 147 chars

N=input()
S=lambda i,K:1+sum(0if len(set(j&amp;k for k in K)-K)-1 else S(j+1,K|set(j|k for k in K))for j in range(i,2**N))
print S(1,set([0,2**N-1]))


Quick for N&lt;=6, slow for N=7, unlikely N>=8 will ever complete.

Individual sets are represented by integer bitmasks, and topologies by sets of bitmasks.  S(i,K) computes the number of distinct topologies you can form by starting with K and adding sets with bitmasks >= i.