Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Tau-number/R/tau-number.r
Normal file
18
Task/Tau-number/R/tau-number.r
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
tau <- function(t)
|
||||
{
|
||||
results <- integer(0)
|
||||
resultsCount <- 0
|
||||
n <- 1
|
||||
while(resultsCount != t)
|
||||
{
|
||||
condition <- function(n) (n %% length(c(Filter(function(x) n %% x == 0, seq_len(n %/% 2)), n))) == 0
|
||||
if(condition(n))
|
||||
{
|
||||
resultsCount <- resultsCount + 1
|
||||
results[resultsCount] <- n
|
||||
}
|
||||
n <- n + 1
|
||||
}
|
||||
results
|
||||
}
|
||||
tau(100)
|
||||
Loading…
Add table
Add a link
Reference in a new issue