# How can I get this R code to pass the "1 minute" test for this Project Euler question?

I am attempting to learn R programming by going through the questions in Project Euler.

The code below is my solution to problem 5 which asks for the smallest number that is evenly divisible by 1 through 20.

The code works but takes a very very long time. Project Euler states that all of their problems should take a modern computer < 1 minute.

I know R is not as efficient as other languages but would it be possible to make my solution more efficient?

divis <- function(){
count = 11
tst <- 1:20 %% count # create vector of remainders
while(sum(tst) != 0){ # test if all remainders are 0
count <- count + 1
tst <- count %% 1:20
print(count)
print(tst)
}
}
}