Jordan-Pólya numbers: Difference between revisions
→{{header|Wren}}: Corrected (hopefully) the Decompose function for both versions.
(→{{header|Phix}}: new decomposing routine) |
(→{{header|Wren}}: Corrected (hopefully) the Decompose function for both versions.) |
||
Line 573:
var m = n
var f = []
m = m
if
}
if (m == 1) return f▼
if (f.count > 0) {
var g = Decompose.call(m, start-1)
if (g.count > 0) {
var prod = 1
for (e in g) prod = prod * factorials[e]
}
}
Line 596 ⟶ 602:
}
for (i in [800, 1050, 1800, 2800, 3800]) {
Fmt.print("The $,r Jordan-Pólya number is : $,d", i, v[i-1])
var g = Lst.individuals(Decompose.call(v[i-1], null))
Line 619 ⟶ 625:
The 800th Jordan-Pólya number is : 18,345,885,696
= (4!)⁷ x (2!)²
The 1,050th Jordan-Pólya number is : 139,345,920,000
= 8! x (5!)³ x 2!
The 1,800th Jordan-Pólya number is : 9,784,472,371,200
Line 677 ⟶ 686:
var m = n
var f = []
m = m
if
}
if (m == 1) return f▼
if (f.count > 0) {
var g = Decompose.call(m, start-1)
if (g.count > 0) {
var prod = 1
for (e in g) prod = prod * factorials[e]
}
}
Line 700 ⟶ 715:
}
for (i in [800, 1050, 1800, 2800, 3800]) {
Fmt.print("The $,r Jordan-Pólya number is : $,d", i, v[i-1])
var g = Lst.individuals(Decompose.call(v[i-1], null))
|