Skip to main content
4 of 5
whoops, spelling
user41805
  • 13.4k
  • 6
  • 43
  • 88

#JavaScript, 19 18 bytes

1 byte saved thanks to @RickHitchcock

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