# NOT RUN {
# Compose 10, 11, 20, 21, 22, 30, ..., 33, ..., 90, ..., 99 into a vector
gen.vector(x * 10 + y, x = 1:9, y = 1:x)
# A data frame of all tuples (a_1, a_2, a_3) of whole positive numbers, summing up to 10
gen.data.frame(c(a_1 = x_1, ..., a_3 = x_3), x_ = 1:10, x_1 + ... + x_3 == 10)
# A data.frame containing the numbers in 2:20 and the sum of their divisors
gen.data.frame(c(num = a, sumdiv = sum(gen.vector(x, x = 1:(a-1), a %% x == 0))),
a = 2:20)
# Return perfect numbers between 2 and 100 (number equals the sum of divisors)
gen.vector(a, a = 2:100, a == sum(gen.vector(x, x = 1:(a-1), a %% x == 0)))
# }
Run the code above in your browser using DataCamp Workspace