Timeline for Am I a Fibonacci Number?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 16, 2017 at 13:08 | comment | added | mb7744 | That makes sense, fair enough. | |
Jun 16, 2017 at 13:00 | comment | added | JAD | @mb7744 Yes you could. But as with all the programming languages, the package should predate the challenge. This is so you couldn't make a package with functions that directly solve the challenge. | |
Jun 16, 2017 at 12:58 | comment | added | mb7744 |
I'm not so familiar with code golf rules -- does allowing non-base packages make sense? I could write arbitrary R code into a package, install it, and run it the same way you have run the function from pryr .
|
|
Jun 16, 2017 at 9:58 | comment | added | rturnbull | I got it down to 32 bytes, see here. | |
Jun 16, 2017 at 8:12 | comment | added | rturnbull |
An alternative approach, only 36 bytes: pryr::f(any(!(5*n^2+c(-4,4))^.5%%1)) .
|
|
Jun 14, 2017 at 20:43 | history | edited | JAD | CC BY-SA 3.0 |
added 31 characters in body
|
Jun 14, 2017 at 20:42 | comment | added | JAD | @MickyT Oh, I must've overlooked the required range specification. Thanks :) | |
Jun 14, 2017 at 20:39 | comment | added | MickyT |
-1:x+1 will save you a byte, but 0:45 will save you three and cover the required range
|
|
Jun 14, 2017 at 18:01 | history | answered | JAD | CC BY-SA 3.0 |