Anonymous user
Count in factors: Difference between revisions
→{{header|R}}
(Wrote a R code for countinfactors function) |
|||
Line 2,624:
=={{header|R}}==
<lang R>
#initially I created a function which returns prime factors then I have created
findfactors <- function(num) {
Line 2,641:
x
}
</lang>▼
count_in_factors=function(x){
primes=findfactors(x)
Line 2,654:
<pre>
[1] "3 x 3 x 2 x 2 x 2 x 1"
▲</lang>
</pre>
|