Skip to main content

Timeline for Am I a Fibonacci Number?

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
Jul 19, 2022 at 17:15 comment added Eric Xue -1 bytes: replace int[]i with var i
Jun 15, 2017 at 8:18 comment added TheLethalCoder @CarlosAlejo Save a further 2 bytes on that with a+=b instead of a=a+b and b+=a instead of b=a+b.
Jun 14, 2017 at 20:08 comment added Charlie I wrote my own answer only to realize that it was the same as yours. You can use lambda expressions and simple variables to get this: n=>{int a=0,b=1,c=0;while(a<n&b<n)if(++c%2>0)a=a+b;else b=a+b;return a==n|b==n;} (just 80 bytes). Try it online!
Jun 14, 2017 at 19:36 comment added Martin Ender Welcome to PPCG!
Jun 14, 2017 at 19:30 review First posts
Jun 14, 2017 at 19:36
Jun 14, 2017 at 19:28 history answered Kaito Kid CC BY-SA 3.0