Skip to main content
added 168 characters in body
Source Link
Khaled.K
  • 1.5k
  • 10
  • 12

C, 3130 bytes

Try Online 1-indexed

s;f(n){s+=n>2s=n>2?f(n-2)-f(n-1):n;}

1-indexed

C, 31 bytes

s;f(n){s+=n>2?f(n-2)-f(n-1):n;}

1-indexed

C, 30 bytes

Try Online 1-indexed

s;f(n){s=n>2?f(n-2)-f(n-1):n;}
Source Link
Khaled.K
  • 1.5k
  • 10
  • 12

C, 31 bytes

s;f(n){s+=n>2?f(n-2)-f(n-1):n;}

1-indexed