Strange plus numbers: Difference between revisions
Content deleted Content added
+R |
|||
Line 1,638:
389 411 412 414 416 430 432 434 438 470
474 476 492 494 498</pre>
=={{header|R}}==
<lang rsplus>pr <- c(F, F, T, T, F, T, F, T, F, F, F, T, F, T, F, F, F, T, F)
is.strange <- function(n) {
a <- as.integer(strsplit(as.character(n), "")[[1]])
pr[a[[1]] + a[[2]] + 1] && pr[a[[2]] + a[[3]] + 1]
}
a <- 101:500
a[sapply(a, is.strange)]</lang>
{{out}}
<pre> [1] 111 112 114 116 120 121 123 125 129 141 143 147 149 161 165 167 202 203 205 207 211 212 214
[24] 216 230 232 234 238 250 252 256 258 292 294 298 302 303 305 307 320 321 323 325 329 341 343
[47] 347 349 383 385 389 411 412 414 416 430 432 434 438 470 474 476 492 494 498</pre>
=={{header|Raku}}==
|