Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Y <- seq(2,8,2) # desired integers
- X <- 239 # input
- X <- as.numeric(strsplit(as.character(239), "")[[1]]) # Vectorize your input
- Y <- Y[!Y %in% X[lapply(X, "%%", 2) == 0]] # get difference between X and Y
- Y # print result, should be something like [1] 4 6 8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement