Mian-Chowla sequence: Difference between revisions
Content added Content deleted
(→{{header|JavaScript}}: Updated JS for parallel to functional version in Python) |
m (→Functional Python: (simplified structure by slightly enriching type of nextMC)) |
||
Line 1,181: | Line 1,181: | ||
while True: |
while True: |
||
yield x |
yield x |
||
(sumSet, x) = nextMC(sumSet, mcs, x) |
(sumSet, mcs, x) = nextMC(sumSet, mcs, x) |
||
mcs.append(x) |
|||
Line 1,200: | Line 1,199: | ||
[x + y for y in mcs] + [2 * x] |
[x + y for y in mcs] + [2 * x] |
||
) |
) |
||
return (setSums, x) |
return (setSums, mcs + [x], x) |
||