All pastes #405278 Raw Edit

Stuff

public python v1 · immutable
·published 2007-03-21 17:15 UTC
rendered paste body
#!/usr/bin/pythondef facsum(i):	fac = [1,1,2,6,24,120,720,5040,40320,362880]	s = 0	for d in list(str(i)):		s += fac[int(d)]	return sdef already(l):	x = {}	y = []	for i in l:		x[i] = 0	for i in l:		x[i] += 1	for i in l:		if x[i] == 1:			y.append(i)	if len(l) == len(y):		return 0	else:		return 1def uniqueterms(i):	fac = []	fac.append(i)	while not already(fac):		fac.append(facsum(fac[len(fac)-1]))	return len(fac)-1