Hofstadter Figure-Figure sequences: Difference between revisions
Content added Content deleted
ReeceGoding (talk | contribs) (→{{header|R}}: Made the final task's output much more explicit.) |
ReeceGoding (talk | contribs) m (→{{header|R}}) |
||
Line 2,236: | Line 2,236: | ||
invisible(ffs(960)) |
invisible(ffs(960)) |
||
#In R, "the first 40 values of ffr plus the first 960 values of ffs" can easily be misread. |
#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 |
#rValues[1:40]+sValues[1:960] is valid R code. It will duplicate the first 40 rValues 23 |
||
#times, append them, and add that vector to the first 960 sValues. |
#times, append them to the original, and add that vector to the first 960 sValues. |
||
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]. |
#Presumably, the task wants us to append rValues[1:40] and sValues[1:960]. |
||
print(table(c(rValues[1:40], sValues[1:960])))</lang> |
print(table(c(rValues[1:40], sValues[1:960])))</lang> |