Anonymous user
Greedy algorithm for Egyptian fractions: Difference between revisions
Greedy algorithm for Egyptian fractions (view source)
Revision as of 10:55, 21 April 2014
, 10 years ago→{{header|Python}}: Show check on answers validity. (So the D implementation can be more confident) ;-
(+ D entry) |
(→{{header|Python}}: Show check on answers validity. (So the D implementation can be more confident) ;-) |
||
Line 173:
for fr in set(Fr(a, b) for a in range(1,100) for b in range(1, 100)):
e = ef(fr)
#assert sum((f[0] if type(f) is list else f) for f in e) == fr, 'Whoops!'
elen, edenom = len(e), e[-1].denominator
if elen > lenmax[0]:
|