guru = function (n){
if (n>0){
x = (n%%(1:n) == 0)
cat(x)
}
}
So, I need to create a vector that contains all the divisors of n
, but when I test, with some value of n
, it logically tells me whether such a number in the division gives rest 0 or not , I wanted to know how do I know what numbers and how do I store such numbers in a vector.
Ex: guru (3)
TRUE FALSE TRUE