Jump to content

Hofstadter Figure-Figure sequences: Difference between revisions

m
(→‎{{header|R}}: Made the final task's output much more explicit.)
Line 2,236:
invisible(ffs(960))
#In R, "the first 40 values of ffr plus the first 960 values of ffs" can easily be misread.
#rValues[1:40]+sValues[1:960] is valid R code. It will duplicate the first 40 rValues 2423
#times, append them to the original, and add that vector to the first 960 sValues. This gives an output of
#This gives an output of length 960, which clearly cannot contain 1000 different values.
#Presumably, the task wants us to append rValues[1:40] and sValues[1:960].
print(table(c(rValues[1:40], sValues[1:960])))</lang>
331

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.