Skip to main content
Commonmark migration
Source Link

[Jelly]Jelly,  8 7  6 [bytes]bytes

-r‘ÆḞċ 

[Try it online!][TIO-j3x8ymyn]Try it online!

How?

-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1 r - inclusive range = [-1,0,1,2,3,4,5,...,n] ‘ - increment n = [ 0,1,2,3,4,5,6,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,5,8,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) 

Notes:

[Jelly],  8 7  6 [bytes]

-r‘ÆḞċ 

[Try it online!][TIO-j3x8ymyn]

How?

-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1 r - inclusive range = [-1,0,1,2,3,4,5,...,n] ‘ - increment n = [ 0,1,2,3,4,5,6,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,5,8,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) 

Notes:

Jelly,  8 7  6 bytes

-r‘ÆḞċ 

Try it online!

How?

-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1 r - inclusive range = [-1,0,1,2,3,4,5,...,n] ‘ - increment n = [ 0,1,2,3,4,5,6,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,5,8,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) 

Notes:

  • the increment, , is needed so this works for 2 and 3, since they are the 3rd and 4th Fibonacci numbers - beyond 3 all Fibonacci numbers are greater than their index.
  • the - is needed (rather than just ‘R) so this works for 0 since 0 is the 0th Fibonacci number;
added 7 characters in body
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293

[Jelly],  8 7  6 [bytes]

-r‘ÆḞċ 

[Try it online!][TIO-j3x8ymyn]

How?

-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1 r  - incrementinclusive nrange = [-1,0,1,2,3,4,5,...,n]   = n+1  r - increment n - inclusive range = [-1, 0,1,2,3,4,5,6,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,5,8,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) 

Notes:

[Jelly],  8 7  6 [bytes]

-r‘ÆḞċ 

[Try it online!][TIO-j3x8ymyn]

How?

-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1  - increment n = n+1  r - inclusive range = [-1,0,1,2,3,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) 

Notes:

[Jelly],  8 7  6 [bytes]

-r‘ÆḞċ 

[Try it online!][TIO-j3x8ymyn]

How?

-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1 r - inclusive range = [-1,0,1,2,3,4,5,...,n]   - increment n = [ 0,1,2,3,4,5,6,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,5,8,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) 

Notes:

added 34 characters in body
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293

[Jelly],  8 7  6 [bytes]

-r‘ÆḞċ 

[Try it online!][TIO-j3x8ymyn]

How?

-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1 ‘ - increment n = n+1 r - inclusive range = [-1,0,1,2,3,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) 

Notes:

[Jelly],  8 7  6 [bytes]

-r‘ÆḞċ 

[Try it online!][TIO-j3x8ymyn]

How?

-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1 ‘ - increment n = n+1 r - inclusive range = [-1,0,1,2,3,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) 

Notes:

[Jelly],  8 7  6 [bytes]

-r‘ÆḞċ 

[Try it online!][TIO-j3x8ymyn]

How?

-r‘ÆḞċ - Link: non negative number, n - - literal -1 = -1 ‘ - increment n = n+1 r - inclusive range = [-1,0,1,2,3,...,n+1] ÆḞ - Fibonacci = [ 0,1,1,2,3,...,fib(n+1)] ċ - count occurrences of n (1 if n is a Fibonacci number, 0 otherwise) 

Notes:

added 67 characters in body
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293
Loading
added 592 characters in body
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293
Loading
added 21 characters in body
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293
Loading
Source Link
Jonathan Allan
  • 115.5k
  • 8
  • 68
  • 293
Loading