Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Perfect-numbers/Lasso/perfect-numbers-1.lasso
Normal file
15
Task/Perfect-numbers/Lasso/perfect-numbers-1.lasso
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/lasso9
|
||||
|
||||
define isPerfect(n::integer) => {
|
||||
#n < 2 ? return false
|
||||
return #n == (
|
||||
with i in generateSeries(1, math_floor(math_sqrt(#n)) + 1)
|
||||
where #n % #i == 0
|
||||
let q = #n / #i
|
||||
sum (#q > #i ? (#i == 1 ? 1 | #q + #i) | 0)
|
||||
)
|
||||
}
|
||||
|
||||
with x in generateSeries(1, 10000)
|
||||
where isPerfect(#x)
|
||||
select #x
|
||||
1
Task/Perfect-numbers/Lasso/perfect-numbers-2.lasso
Normal file
1
Task/Perfect-numbers/Lasso/perfect-numbers-2.lasso
Normal file
|
|
@ -0,0 +1 @@
|
|||
6, 28, 496, 8128
|
||||
Loading…
Add table
Add a link
Reference in a new issue