Erdős–Woods numbers: Difference between revisions
→{{header|Wren}}: Tidied but no quicker.
(julia example) |
(→{{header|Wren}}: Tidied but no quicker.) |
||
Line 201:
var A = BigInt.new(a)
var s = primes.map { |p| Conv.btoi(A % p == 0).toString }.join()[-1..0]
divs.add(BigInt.new(Conv.atoi(s, 2)))
}
}
var partitions = [ [zero, zero, two.pow(np) - one] ]
var key = Fn.new { |x|
var cmp = Fn.new { |i, j| (key.call(j) - key.call(i)).sign }
for (i in Sort.merge((1...n).toList, cmp)) {
var newPartitions = []
var factors =
var otherFactors =
for (p in partitions) {
var setA = p[0]
Line 251:
}
var N = BigInt.new(n)
var temp = x.
result = result ? BigInt.min(result, temp) : temp
}
Line 259:
var k = 3
var count = 0
System.print("
while (count < 20) {
var a = ew.call(k)
Line 271:
{{out}}
<pre>
16 -> 2184
22 -> 3521210
|