Proper divisors: Difference between revisions
Content added Content deleted
ReeceGoding (talk | contribs) (→{{header|R}}: New solution.) |
ReeceGoding (talk | contribs) |
||
Line 4,319:
===Filter solution===
<lang r>#Task 1
#Task 1▼
#Has no input error checking.
divisors<-function(n)
Line 4,342 ⟶ 4,341:
". It has ",length(divisorList[[numberWithMostDivisors]])," divisors."))
}
mostProperDivisors(20000)</lang>
{{Output}}
> Vectorize(divisors)(1:10)
[[1]]
Line 4,382 ⟶ 4,378:
#Task 3
> mostProperDivisors(20000)
[1] "The number with the most divisors between 1 and 20000 is 15120. It has 79 divisors."</pre>
=={{header|Racket}}==
|