Skip to main content
3 of 5
added 22 characters in body
user41805
  • 13.4k
  • 6
  • 43
  • 88

#JavaScript, 19 18 bytes

1 byte saved thanks to @RichHitchcock

f=a=>a&&1/a+f(--a) 

This is 1-indexed.

f=a=>a&&1/a+f(--a) for(i=0;++i<10;)console.log(f(i))

user41805
  • 13.4k
  • 6
  • 43
  • 88