Mian-Chowla sequence: Difference between revisions
m
→{{header|Wren}}: Changed to Wren S/H
m (→{{header|Wren}}: Changed to Wren S/H) |
|||
(One intermediate revision by one other user not shown) | |||
Line 1,949:
=={{header|Sidef}}==
{{trans|Go}}
<syntaxhighlight lang="ruby">var (n, sums, ts, mc) = (100, Set(
var st = Time.
for i in (1 ..^ n) {
for j in (mc[i-1]+1 .. Inf) {
Line 1,956:
for k in (0 .. i) {
var sum = mc[k]+j
if (sums.
ts.clear
break
Line 1,963:
}
if (ts.len > 0) {
sums |=
break
}
}
}
var et = (Time.
var s = " of the Mian-Chowla sequence are:\n"
say "The first 30 terms#{s}#{mc.
say "Terms 91 to 100#{s}#{mc.
say "Computation time was #{et} seconds."</syntaxhighlight>
{{out}}
Line 1,980:
22526 23291 23564 23881 24596 24768 25631 26037 26255 27219
Computation time was
=={{header|Swift}}==
Line 2,182:
=={{header|Wren}}==
{{trans|C#}}
<syntaxhighlight lang="
var mc = List.filled(n, 0)
var sums = {}
|