rValues <- 1
sValues <- 2
ffr <- function(n)
{
  if(!is.na(rValues[n])) rValues[n] else (rValues[n] <<- ffr(n-1) + ffs(n-1))
}




ffs <- function(n)
{
  if(!is.na(sValues[n])) sValues[n] else (sValues[n] <<- setdiff(seq_len(1 + ffr(n)), rValues)[n])
}


invisible(ffr(10))
print(rValues)




invisible(ffs(500))
invisible(ffs(960))



This gives an output of length 960, which clearly cannot contain 1000 different values.

print(table(c(rValues[1:40], sValues[1:960])))