Fusc sequence: Difference between revisions
→{{header|R}}: Improved speed and readability of which() calls.
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: terminology) |
ReeceGoding (talk | contribs) (→{{header|R}}: Improved speed and readability of which() calls.) |
||
Line 2,324:
A proper solution that only gives one non-trivial result is as follows:
<lang r>index<-which.max(nchar(first61)==2)
number<-first61[index]
cat("The first fusc number that is longer than all previous fusc numbers is",number,
Line 2,331:
<lang r>twentyMillion<-firstNPlus1FuscNumbers(2*10^7-1)
twentyMillionCountable<-format(twentyMillion,scientific = FALSE,trim = TRUE)
indices<-sapply(2:6, function(x)
numbers<-twentyMillion[indices]
cat("Some fusc numbers that are longer than all previous fusc numbers are:\n",
|