Anonymous user
Aliquot sequence classifications: Difference between revisions
Remove proper divisors part from Scala solution
(Scala solution) |
(Remove proper divisors part from Scala solution) |
||
Line 753:
=={{header|Scala}}==
With [[proper_divisors#Scala]] /Proper divisors for big (long) numbers/ in place:
<lang Scala>def createAliquotSeq(n: Long, step: Int, list: List[Long]): (String, List[Long]) = {▼
▲def createAliquotSeq(n: Long, step: Int, list: List[Long]): (String, List[Long]) = {
val sum = properDivisors(n).sum
if (sum == 0) ("terminate", list ::: List(sum))
|