expected(n)=sum(i=1,n,n!/(n-i)!/n^i,0.); test(n, times)={ my(ct); for(i=1,times, my(x=1,bits); while(!bitand(bits,x),ct++; bits=bitor(bits,x); x = 1<