Factor-perfect numbers: Difference between revisions
→{{header|Wren}}: Added a final 48 for consistency with other examples.
m (→{{header|Phix}}: final 48 back in) |
(→{{header|Wren}}: Added a final 48 for consistency with other examples.) |
||
Line 344:
var listing = moreMultiples.call([1], Int.properDivisors(48))
listing.add([1, 48])▼
listing.sort { |l1, l2|
var c1 = l1.count
Line 355 ⟶ 354:
return false
}
listing.each { |l| l.add(48) }
▲listing.add([1, 48])
System.print("%(listing.count) sequences using first definition:")
Fmt.tprint("$-17n", listing, 4)
Line 380 ⟶ 381:
<pre>
48 sequences using first definition:
[1, 2, 48]
[1, 2, 4, 8, 24
[1, 2, 4, 24
[1, 2, 6, 24
[1, 2, 12, 48]
[1, 3, 48]
[1, 3, 6, 24
[1, 4, 48]
[1, 4, 12, 48]
[1, 6, 48]
[1, 8, 48]
[1, 12, 24, 48]
48 sequences using second definition:
|