4 return 2**x
* 3**y
* 5**z
11 while len(uglies
) < maxValue
:
12 uglies
.append(counter
)
15 d
[value(x
+1, y
, z
)] = (x
+1, y
, z
)
16 d
[value(x
, y
+1, z
)] = (x
, y
+1, z
)
17 d
[value(x
, y
, z
+1)] = (x
, y
, z
+1)
31 uvalue
= ugly(iterations
)
33 print iterations
, "ugly value =", uvalue
, "in", (end
- start
)*1000, "ms"