Anonymous user
Talk:Sieve of Eratosthenes: Difference between revisions
m
→R code error: funny typo
m (→R code error: funny typo) |
|||
Line 324:
return(list[A[-1]]) #remove 1
}
:Corrected. Some oddities in your own program: once you have computed i^2, no need to compute sqrt(n), just compare i^2 and n. Also, no need for 'list', use the 'which' function. You may replace 'break' with 'return' and 'repeat' with a 'for' loop since you are incrementing the index 'i' at the end of each loop. Last, but not
|