Proper divisors: Difference between revisions
Content added Content deleted
ReeceGoding (talk | contribs) |
ReeceGoding (talk | contribs) m (→Package solution: Formatting) |
||
Line 4,302: | Line 4,302: | ||
===Package solution=== |
===Package solution=== |
||
{{Works with|R|3.3.2 and above}} |
{{Works with|R|3.3.2 and above}} |
||
⚫ | |||
<lang r> |
|||
⚫ | |||
require(numbers); |
require(numbers); |
||
V <- sapply(1:20000, Sigma, k = 0, proper = TRUE); ind <- which(V==max(V)); |
V <- sapply(1:20000, Sigma, k = 0, proper = TRUE); ind <- which(V==max(V)); |
||
cat(" *** max number of divisors:", max(V), "\n"," *** for the following indices:",ind, "\n"); |
cat(" *** max number of divisors:", max(V), "\n"," *** for the following indices:",ind, "\n");</lang> |
||
</lang> |
|||
{{Output}} |
{{Output}} |
||
⚫ | |||
<pre> |
|||
⚫ | |||
*** max number of divisors: 79 |
*** max number of divisors: 79 |
||
*** for the following indices: 15120 18480 |
*** for the following indices: 15120 18480 </pre> |
||
</pre> |
|||
===Filter solution=== |
===Filter solution=== |