[Question]
  [
The [Kempner series](https://en.wikipedia.org/wiki/Kempner_series) is a series that sums the inverse of all positive integers that don't contain a "9" in their base-10 representations (i.e., \$\frac{1}{1} + \frac{1}{2} + \frac{1}{3} + .. + \frac{1}{8} + \frac{1}{10} + ...\$).
It can be shown that, unlike the Harmonic series, the Kempner series converges (to a value of about 22.92067661926415034816).
**Your task is to find the partial sums of the Kempner series.** These are the ways you can do it:
* Take a number \$n\$, and return the sum of the inverse of the first \$n\$ numbers that don't have a "9" in them, which is the \$n\$th partial sum of the series.
* Take a number \$n\$, and return the first \$n\$ partial sums of the series.
* Don't take any input and output the partial sums infinitely.
You can choose if your input is 0-indexed or 1-indexed.
~~Your algorithm result's distance from the correct value may not be over \$10^{-4}\$, for all possible values of \$n\$.~~ While your algorithm should work theoretically for all values for N, you may ignore inaccuracies coming from floating-point errors.
Test cases, in case of returning the \$n\$th partial sum, 0-indexed:
```
0 -> 1.0
1 -> 1.5
9 -> 2.908766...
999 -> 6.8253...
```
Standard loopholes are disallowed.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest answer in bytes wins.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~7~~ 6 bytes
```
Rb9ḌİS
```
[Try it online!](https://tio.run/##y0rNyan8/z8oyfLhjp4jG4L/P2qYcbj9/39LS0sA "Jelly – Try It Online")
*-1 byte thanks to @Razetime*
Takes input 1-indexed as an argument (footer on TIO converts to 0-indexed like in test cases)
Returns the nth partial sum
### How it Works
Let's look at the denominators in base 10:
\$[1, 2, 3, 4, 5, 6, 7, 8, 10,11,12,13,...]\$ (base 10)
Since these consist of the nine base-9 digits, we can interpret them as base 9 strings:
\$[1\_9, 2\_9, 3\_9, 4\_9, 5\_9, 6\_9, 7\_9, 8\_9, 10\_9, 11\_9, 12\_9, 13\_9, ...]\$
\$=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]\$ (base 10)
So all of the denominators can be generated as natural numbers, converted to base 9, then interpreted as base 10.
```
Rb9ḌİS - main link, taking n (1-indexed)
R       - convert to list [1..n]
 b9     - convert each natural number to base 9
   Ḍ   - interpret each base-9 string as base 10 (decimal)
    İ  - reciprocal
     S - sum
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 52 39 36 bytes
*-13 bytes thanks to Dingus!*
*-3 bytes thanks to Sisyphus*
```
x=0;"#$."[?9]||p(x+=1r/$.)while$.+=1
```
[Try it online!](https://tio.run/##KypNqvz/v8LWwFpJWUVPKdreMrampkCjQtvWsEhfRU@zPCMzJ1VFD8j9/x8A "Ruby – Try It Online")
Prints all values.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~9~~ 5 bytes
-4(!) bytes thanks to [Command Master](https://codegolf.stackexchange.com/users/92727/command-master)!
Outputs one value 1-indexed
```
L9BzO
```
[Try it online!](https://tio.run/##yy9OTMpM/f/fx9Kpyv//f0MDAwMA "05AB1E – Try It Online") or [Try all cases!](https://tio.run/##yy9OTMpM/V/jYndu638fS6cq//@1h3cc2v3fgMuQy5LL0tISAA "05AB1E – Try It Online")
```
L      # push the range [1..n]
 9B    # convert each number to base 9
       # this yields the first n natural numbers that don't contain a 9
   z   # take reciprocal of each number
    O  # sum the list
```
[Answer]
# Scala, 56 bytes
```
Stream from 1 filterNot(_+""toSet 57)take _ map 1.0./sum
```
[Try it online!](https://scastie.scala-lang.org/TzCD41TkQwS4jKxnJLLQAg)
1-indexed. Returns the sum of the inverses of the first \$n\$ numbers.
```
Stream from 1      //Infinite list of integers, starting at 1
  filterNot(       //Remove the ones with a 9
    _ + ""         //Convert to string
      toSet        //A Set is also a predicate. Check if it contains
      57)          //57, '9' as an integer
  take _           //Take the first n numbers
  map 1.0./        //Divide 1 by each
  sum              //Sum them
```
## Just for completeness, 58 bytes
```
(Stream.from(1)filterNot(_+""toSet 57)scanLeft.0)(_+1.0/_)
```
[Try it online!](https://scastie.scala-lang.org/kXgXdHMESPeSJsR3OCsBGw)
This is an infinite stream of partial sums, but also a function that gives the \$n\$th partial sum (1-indexed). You can also use `take` on it to get the first \$n\$ partial sums. Unfortunately, it's a little longer than the version above.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
1w9¬$#İS
```
[Try it online!](https://tio.run/##y0rNyan8/9@w3PLQGhXlIxuCgWwDAwMA "Jelly – Try It Online")
1-indexed, takes input from STDIN, returns the \$n\$th partial sum
My last Jelly answer of the year, and it just so happens to outgolf Husk!
## How it works
```
1w9¬$#İS - Main link. Takes no arguments
1   $#   - Find the first n numbers that meet the following criterion:
 w9      -   The index of 9 in the number’s digits...
   ¬     -   ...is 0 (i.e. 9 is not in the digits)
      İ  - Invert each number
       S - Sum
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~12~~ 10 bytes
Saved 2 bytes on both solutions thanks to [@Razetime](https://codegolf.stackexchange.com/users/80214/razetime)!
```
ṁ\↑fȯ¬#9dN
```
[Try it online!](https://tio.run/##yygtzv7//@HOxphHbRPTTqw/tEbZMsXv////hgYGBgA "Husk – Try It Online")
It's been a while since my last Husk answer. This one outputs the \$n\$th number. It outputs a fraction, but I've [checked](https://scastie.scala-lang.org/Cbn3xUlsQVCVdKDdoWslJw) and it seems to be correct.
Explanation
```
ṁ\↑fȯ¬#9dN
         N    Infinite list of natural numbers
   f          Filter by predicate:
        d     Digits in base 10
      #9      Number of occurrences of digit 9
     ¬        Negate that
  ↑           Take the first n elements (implicit input)
ṁ\            Map each to its reciprocal
ṁ             And sum
```
### Infinite sequence, also ~~12~~ 10 bytes
```
∫m\fȯ¬#9dN
```
[Try it online!](https://tio.run/##yygtzv7//1HH6tyYtBPrD61Rtkzx@/8fAA "Husk – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 20 bytes
```
1#.10%@#.9#.inv>:@i.
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/DZX1DA1UHZT1LJX1MvPK7KwcMvX@a3JxpSZn5CukKRjCGEZwEQMEy8CA6z8A "J – Try It Online")
I just wanted to see if I could golf [fireflame's excellent Jelly answer](https://codegolf.stackexchange.com/a/217099/15469) in J.
1 based indexing.
* `>:@i.` Integers 1..argument
* `9#.inv` Each as a list of digits in base 9
* `10#.` Back to single number in base 10
* `%@` Reciprocal of each
* `1#.` Sum
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~8~~ 7 bytes
```
ṁȯ\dB9ḣ
```
[Try it online!](https://tio.run/##yygtzv7//@HOxhPrY1KcLB/uWPz//39DAwMDAA "Husk – Try It Online")
Outputs the \$n^{th}\$ partial sum. I tried using `İ\` from [here](https://github.com/barbuz/Husk/wiki/Sequences), but it's longer.
Uses fireflame's idea.
-1 byte from user.
## Explanation
```
∫mȯ\dB9N
       N the list of natural numbers
 mȯ      map to:
     B9  base 9 digits
    d    represented as base 10 number
   \     take reciprocal
∫        take the cumulative sum
```
[Answer]
# [Python 2](https://docs.python.org/2/), 54 bytes
```
f=lambda k,n=1,b=0:k<2or b/n+f(k-b,n+1,1.-('9'in`~n`))
```
[Try it online!](https://tio.run/##DcuxDoIwEIDhWZ7iNgocSEkcSuyTGBOoQrwA16atA4uvXjv82/@5M34sD4kOZ32EcIYi14Ul@uX19YEs73RQFLKv61uVVr3Ph3nPsCFriUb343YfrAdz5WYVW2uQG4mya0WpSuLpx1OVWT4YiOHRo0SFSqnnWFycJ47ACKvIqkp/ "Python 2 – Try It Online")
One-indexed. Avoids repeating the `'9'in`n+1`` by passing it as an optional argument `b` to the next iteration of the function where the actual calculation is done.
**58 bytes**
```
f=lambda k,n=1.:k and f(k-1+('9'in`n`),n+1)-~-('9'in`n`)/n
```
[Try it online!](https://tio.run/##RYyxDoMgFADn@hVvExSsNOmAiV/SNNFWSV@QBwE6uPTXqZ063HLJXdjzy9OloAs@Zkh7qg66tOa4Pt8xoacNHWam@qa58mLGbXaPZQYraFTdYGGmBQyzUrWs1jXSRBMX1CouP/JvzlSMj0CABLdeKKGF1vo@VKcQkTKQOCa/qnwB "Python 2 – Try It Online")
**59 bytes**
```
f=lambda k,n=1:'9'in`n`and f(k,n+1)or k and 1./n+f(k-1,n+1)
```
[Try it online!](https://tio.run/##HczNDoIwEATgszzF3viryJpwKAlPYkyoQuMGum3aeuDpa@Uwl28m4474sXxPZJz1EcIRipwurNGv768PZHknQ7HCvmmGOulpV@a1KNgETziWsiSeeVa8gK6ytVhbDxv8Absbt1mveHrSuWEghkcvUEghpXyOxcV54ggs8sE5@wE "Python 2 – Try It Online")
**62 bytes**
```
lambda k:sum([1./n for n in range(1,k*k+1)if~-('9'in`n`)][:k])
```
[Try it online!](https://tio.run/##PcuxDsIgFEDR2X7F2woVazFxoIlfgiStWvSF8miADl38dezkcLdzly1/Al0K@iXEDGlL1V6bphyn5xoTBprRY2aya5orr@ztXubRP14juD6tnmnZnglsiECABHGk98SkcI07So72e2K1qpEGGrjRvTO8/K3uhBRKKKVMXx2WiJSBBFhG@1p@ "Python 2 – Try It Online")
The `k*k+1` can be `2**k`, saving a byte but making the code really slow.
**64 bytes**
```
s=0
n=1
exec"while'9'in`n`:n+=1\ns+=1./n;n+=1\n"*input()
print s
```
[Try it online!](https://tio.run/##JYzBCoMwEAXv@YriRY1gTaGHtORPehBkwQV9CdmV1q@PgR5mYC6TTl0jHoX3FLPe5BRTGYU003Jk4YiNd9bOTdY@@yJhMgjO0I@W5rvyRq1vGTPmF4bgPpDq8Y73vxrLSId2vUmZUf@leO8v "Python 2 – Try It Online")
---
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 53 bytes
```
f=lambda k,n=1:k and(b:=max(str(n))<'9')/n+f(k-b,n+1)
```
[Try it online!](https://tio.run/##FctBDoIwEEDRtZxidkyhKo0xscSexLgoArGBTptpTeT0FRd/937c8jvQ5Ra5OB8DZ0hbqvZOaco8vT6cXKDVeZdRdU1zFWU2q/XDaGGRZFS/gKURh954@8WUGUmIe61rcaZ2xuU4SGrVfgUGAkfw6KSSWmqtn311iOwoA5KEGf9OlB8 "Python 3.8 (pre-release) – Try It Online")
*Saved one byte thanks to @dingledooper.*
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 11 bytes
```
ＩΣ∕¹ＩＥＮ⍘⊕ι⁹
```
[Try it online!](https://tio.run/##JYtBDkAwEAC/4rgSkjqKGy4OROIFqzY00ZJ26/urYY4zGX2g1xeeIrM3jqHDwLBEC715zEZQFdmnRrxhcHfkKdqVPORF1mKghdO1p6I9WXJMG5iU6vynEamUUlI@5ws "Charcoal – Try It Online") Link is to verbose version of code. 1-indexed. Explanation:
```
     Ｎ      Input number
    Ｅ       Map over implicit range
         ι  Current index
        ⊕   Incremented
       ⍘  ⁹ Convert to base 9 as a string
    Ｉ       Vectorised cast to integer
  ∕¹        Vectorised reciprocal
 Σ          Sum
Ｉ           Cast to string
            Implicitly print
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~78~~ 77 bytes
```
def f(n,i=.0,s=0):
 while n:
	i+=1
	while"9"in`i`:i+=1
	s+=1/i;n-=1
 return s
```
[Try it online!](https://tio.run/##JYzBCoMwEETP7lcsnhJq2423RvIvHprggqwhiYhfH4PCMPAezMSzLJuMtf59wKBkYPehITvSFvBYePUoFjp@OQPdzf2vZ5l5to/Lrb88ybsBJl/2JJjrszTtIyaWooJiiXtRWutqYARDLURwAQ "Python 2 – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 30 bytes
```
f=n=>n&&1/n.toString(9)+f(n-1)
```
[Try it online!](https://tio.run/##FcyxCoMwEADQ3a@4QSRHNU26FYmbX9CxFAypsRa5KzG4hHx72g5vfW972N2F9RM74udcijdkBmoafSYZ@RbDSou44skL6jSW/q5buLSg1Z9SD@k5jNa9BIEZIFUAjmnnbZYbL2Kyok6UEQzU6VdgnrCvMpYv "JavaScript (Node.js) – Try It Online")
Convert \$n\$ to base 9, and read the converted result as base 10. Then inverse it. You will get the \$n\$th item.
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-mx`](https://codegolf.meta.stackexchange.com/a/14339/), 6 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
1-indexed
```
1/°Us9
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LW14&code=MS%2bwVXM5&input=MTA)
[Answer]
# [Haskell](https://www.haskell.org/), 45 44 42 bytes
```
f=scanl(+)0[1/x|x<-[1..],all(<'9')$show x]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P822ODkxL0dDW9Mg2lC/oqbCRjfaUE8vVicxJ0fDRt1SXVOlOCO/XKEi9n9uYmaegpWVgqe/goYmF5hnq1BQlJlXoqCikKagqKhgaGBg8B8A "Haskell – Try It Online")
Infinite list. 44 byte thanks to ovs, who suggested `all(<'9')` to replace `not$elem '9'`. 42 bytes thanks to Donat, who suggested `1` to replace `1.0`.
[Answer]
# [Perl 5](https://www.perl.org/), 26 bytes
```
/9/||say$a+=1/$_ while++$_
```
[Try it online!](https://tio.run/##K0gtyjH9/1/fUr@mpjixUiVR29ZQXyVeoTwjMydVW1sl/v//f/kFJZn5ecX/dX1N9QwMDQA "Perl 5 – Try It Online")
[Answer]
# AWK, 37 bytes
```
{for(;++i<=$1;)i~9?$1++:n+=1/i;$1=n}1
```
[Try it online!](https://tio.run/##SyzP/v@/Oi2/SMNaWzvTxlbF0Fozs87SXsVQW9sqT9vWUD/TWsXQNq/W8P9/QwMDAwA "AWK – Try It Online")
```
{
for(;++i<=$1;)  #loops while i<= the input.
                # also increments the variable 1 every loop.
  i~9?    # if there is a 9 in _i_
  $1++:   # skips this _i_, adding 1 to $1
  n+=1/i; # otherwise, adds 1/i to _n_
$1=n  # in the end, assigns _n_ to $1
}
1  # prints $1
```
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 42 bytes
```
Tr[1/FromDigits/@Range@#~IntegerDigits~9]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7P6Qo2lDfrSg/1yUzPbOkWN8hKDEvPdVBuc4zryQ1PbUIIlxnGav2P6AoM68kWlnXLs1BOVatLjg5Ma@umstQh8tIh8vQAIQNDLhq/wMA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# JavaScript (ES6), 46 bytes
1-indexed.
```
f=(n,i=1)=>n&&(/9/.test(i)?0:n/n--/i)+f(n,i+1)
```
[Try it online!](https://tio.run/##Fcy9CoMwFEDh3ae4g0gu5rdbK7FTn6IUDKm2EbkpKl1Cnj2tw9k@zuy@bvNr@OyC4nMsZbKMeLAGbU9Nw9RZyX3cdhbwqi@kSAgVsJ0O1Bos3d1wOHEw@kjrh5zienP@zQhsD6kC8JG2uIxyiS82OFYnyggW6vSfYB6wqzKWHw "JavaScript (Node.js) – Try It Online")
[Answer]
# [R](https://cran.r-project.org/), ~~94 93 92 64~~ 59 bytes
Thanks to [Dominic van Essen](https://codegolf.stackexchange.com/users/95126/dominic-van-essen) for suggesting a [grepl](https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/grep) shortcut!
```
n=scan()+2;while(n<-n-1){F=F+1/T;while(grepl(9,T<-T+1))0};F
```
[Try it online!](https://tio.run/##K/r/P8@2ODkxT0NT28i6PCMzJ1Ujz0Y3T9dQs9rN1k3bUD8EKppelFqQo2GpE2KjG6JtqKlpUGvt9t8SDP4DAA "R – Try It Online")
[Answer]
# [R](https://www.r-project.org/), ~~45~~ 43 bytes
*Edit: -2 bytes thanks to Giuseppe*
```
x=scan();y=1:x^2;sum(1/y[!grepl(9,y)][1:x])
```
[Try it online!](https://tio.run/##K/r/v8K2ODkxT0PTutLW0Koizsi6uDRXw1C/MloxvSi1IEfDUqdSMzYaKBWr@d/QwMDgPwA "R – Try It Online")
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf/blob/master/math_golf.txt), 10 [bytes](https://github.com/maxbergmark/mathgolf/blob/master/code_page.py)
```
∞╒gÉ9╧┌<∩Σ
```
Outputs the \$n^{th}\$ value with 1-based input \$n\$.
[Try it online.](https://tio.run/##y00syUjPz0n7//9Rx7xHUyelH@60fDR1@aMpPTaPOlaeW/z/vyGXEZehARAZGAAA)
**Explanation:**
```
∞          # Double the (implicit) input-integer
 ╒         # Pop and push a list in the range [1,2*input]
  g        # Filter this list by,
   É       # using the following 3 characters as inner codeblock:
    9╧     #  Check that the integer contains a digit 9
      ┌    #  And invert the boolean
       <   # Only keep the first (implicit) input amount of values of the filtered list
        ∩  # Map all values to 1/n
         Σ # And sum those together
           # (after which the entire stack joined together is output implicitly as result)
```
MathGolf unfortunately doesn't contain base-conversion builtins, except for binary and hexadecimal. So I use a manual filter instead. The double at the start is to ensure we have enough values left after the filter for which we can keep the first input amount of values. After which we'll map them to \$\frac{1}{n}\$, and sum them together.
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 13 bytes
```
+/1%10/9\1+!:
```
[Try it online!](https://ngn.bitbucket.io/k#eJwlyUsKgzAUQNF5VpFCCy1CfJ8kJnlL0YBOAkWhIA6UomuvxcnlwC2pqvGBUMcOq1tSaknfe7sdcypa61X6zyjPvgzvSVbZZH7lXS0tChrIJ+iE+wNByEQIjffEfNXSdQDEm0COQxMtx0DE1rv8A9WOHuo=)
A similar approach to many other answers, modeled after [@fireflame241's Jelly answer](https://codegolf.stackexchange.com/a/217099/98547). Uses 1-based indices.
* `1+!:` generate `1..n`
* `10/9\` convert to base-9, then back to base-10
* `+/1%` take the sum of the inverses
[Answer]
# [Raku](http://raku.org/), 25 bytes
```
[\+] 1 X/grep {!/9/},1..*
```
[Try it online!](https://tio.run/##K0gtyjH7n1up4FCcWqhg@z86RjtWwVAhQj@9KLVAoVpR31K/VsdQT0/rv7WCXnFipUJafhFYbXSckUHsfwA "Perl 6 – Try It Online")
This is an expression for an infinite sequence of the partial sums.
* `grep { !/9/ }, 1..*` is the infinite sequence of all natural numbers with no 9 digit in its decimal representation.
* `1 X/` produces the reciprocals of that sequence. (`X` is the cross-product metaoperator, combined here with the `/` division operator.)
* `[\+]` produces the partial sums of that sequence.
[Answer]
# SmileBASIC 4, 139 bytes
Zero-indexed. Returns the nth partial sum of the series.
```
1  DEF F(X)REPEAT INC U,X MOD 9*POW(10,I)X=X DIV 9INC I UNTIL!X RETURN U END
2  DIM O[1]@0 UNSHIFT O,O[0]+1INC S,1/F(O[0])IF N+2>LEN(0)GOTO@0
3  ?S
```
---
Newline chars on lines 1 & 2 are included in byte count.
The program iterates through integers 0-N, converts each value to base 9, and adds the base-10 interpreted inverse of the value to a sum. Finally, it prints the sum.
[Answer]
# [Perl 5](https://www.perl.org/), 39 bytes
```
sub f{my$r;$r+=!/9//$_ for 1..$_[0];$r}
```
[Try it online!](https://tio.run/##K0gtyjH9/7@4NEkhrTq3UqXIWqVI21ZR31JfXyVeIS2/SMFQT08lPtogFihR@7@gKDOvRCFNQyVeU0cpJk8JrELDUMdIx0LHUsfQQMfQEEgaGGj@BwA "Perl 5 – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~87~~ 84 bytes
Saved 3 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)!!!
```
m;float i,s;float f(n){for(i=s=0;m=n--;s+=1/i)for(;m;)for(m=++i;~m%10*m;m/=10);i=s;}
```
[Try it online!](https://tio.run/##bVFBboMwELznFSskJEiAGAgE5LiXqq9ocqBgWquxiTAH1Ih@ndqxg9KqSDZmZnZ2Gdfhe13PM8ftuasGYIG0p9YT/rXteo8RSRDmRIQhlhsSb5mvYczx7c3JZsPwN3djtOaYb0mMfKxq8DQzMQCvmPD81XUF6tHAQOUgX09A4BoHkAQQI70QmvBNY7rT8ULrgTZWGGlNlCl9VKJin@dJmpp9F0AeFUmWFvtyl5ZFkqSZdao/qn6tdlp/0t4YOcfxJTmO5bNamRPA43fq/J7gItm5E6oqpmFmma4HT/8EEw0dFYWwPR5Asi/atd59cH9rgfWCYFBJabUPJo57JLqJieVGn/DCmlGk4vV1/MWpwpeg/i9t6HmodHn1Jj0Z0gePS696t57jNhA@gduCK49CZSICkMESmzE43OM4WYNpNc0/ "C (gcc) – Try It Online")
Inputs a \$1\$-indexed \$n\$ and returns the \$n^{\text{th}}\$ partial sum of the series.
[Answer]
# x86 Machine Code (x87 FPU), 35 bytes
```
D9 EE 31 F6 8D 7E 0A 46 89 F0 99 F7 F7 83 FA 09 74 F5
85 C0 75 F4 89 33 DB 03 D9 E8 DE F1 DE C1 E2 E5 C3 
```
The above bytes define a function that computes the *n*th partial sum of the Kempner series. The function defines a custom calling convention, whereby it accepts two arguments:
* The value *n* is passed in the `ecx` register (this is an unsigned 32-bit integer value).
* The address of a "scratch" memory buffer is passed in the `ebx` register (the buffer's size must be at least 4 bytes in length).
The function returns a single result, the *n*th partial sum, at the top of the x87 FPU stack (`st(0)`).
**[Try it online!](https://tio.run/##lVbbbts4EH33VwxYZCHBsivbufhSp8AmfdqHLZICLZAEBkNSNluJVCUqVRLk19c7lCxHtuQUFSCJoDWHZ2bOzJjFcW/J2HodhJoa@EdEsRKJk6lULpXgoDzYru@zIBCJ23nuAF6lQSLSLDSzYmexoGm0WDikL5UR4SJ9VIbmoHSciEDmpFN8VV3kVt2aIORPBA5d799Damhi4Jc0K4hxJWkIaRbBfA5@3wcHGRgdgw4gH5@5TfxcJ3YtUunZB2ng4yYgVtMyFLSw5Gh5Y7/qwsC/IzVLbi0HfsOrzyXP6yw6mk9JE1kqtuFE2n0uTkPopmmkHwpTmh9yB@M9tz81WF2sBPtxKZfStLNi/OfhRFjoJ5FodDoHR@kkomH46IFNrEiA2DDjT559kJY0cPmwCeYhl3k@tdyLsLaQi@LSHo@YkBb7RERUKo5cUBmTj02E76JY13NDdoX2Q8YgA@A2RPCLpkBh0sQxIjXbDNC8mYGfmTZSKPzIarSNiXqy63o@dpmEWhdMIp2Ikk6KIgdmDToHNXH59d@rS/j85QrVep/fVfooSsgCWVFhWWpIWUINW0Ek8IDHTVG3VKYMeRO2pv84S1fwQMNMQJDoqB3XEn8t0Nb6H7xZ/8UpAyz13wGhxJIYfXUGrmdfvrsbVUZDloXUiAKtKLIWFMo5Ku0wCmUsi0qYejtyyjYIElXzm45UZPctIXLBUM1WQYLZYkMiVHFgWmHnwGBbAKmWViFKq54ty4Yq@tSYqv2WzfdW7dT8FMjckIq3eyj6OjNxZqyrNBIG0ykVXH/BqOxhMXQBmb7ZP6RqQH26@FYH8oDcW6C/NoPmD4D@/rbHqFThjs9uOaUSYbJEbQfXy/odNuQw4wI@sBQ7lT7v1HYialb1DYknUiyo804Hqwls13Gqibg3KGdlWjBx2DJeB@qGzc0dNupnGHgw9HCK2Nv34WVWsyknrO02eSyYEbyy6dvP@ydo2p/447PT0@FoVD6PPTjtj4cno/HZ5Hg0GQ@Ho5MKNMAm/TrYi7E3w9cH1DmfTlP5JJzqIHcG3a4ss/y8jWHJimZYihu9z7d/GNSNxJ6zSdxsaxInGKXAIUcceudwFMBRikr0OntZLaz3N8szGtuOU/Cl92lVdb3XAMk7Fx0a@KJ37MJHLIX80/A2n1zgPSJWF7WNE@JumL7UheFbTfzHgpAu03UvGg3XPTxwzrrdIf0f "C++ (gcc) – Try It Online")**
In ungolfed assembly language mnemonics:
```
         ; Computes the nth partial sum of the Kempner series.
         ; Input(s):
         ;   ecx = n
         ;   ebx = address of DWORD scratch buffer
         ; Output(s):
         ;   st(0) = nth partial sum
         ; Clobber(s):
         ;   eax, [ebx], ecx, edx, esi, edi, st, flags
         Kempner:
D9 EE      fldz                         ; start with partial sum == 0.0 (at top of x87)
31 F6      xor    esi, esi              ; esi = 0
8D 7E 0A   lea    edi, [esi + 10]       ; edi = 10
         PartialSum:
46         inc    esi                   ; esi += 1
89 F0      mov    eax, esi              ; eax = esi
         
         CheckDigit:
99         cdq                          ; zero edx (normally, prefer xor edx, edx)
F7 F7      div    edi                   ; edx:eax / edi
83 FA 09   cmp    edx, 9                ; remainder == 9?
74 F5      je     PartialSum            ; skip if digit was a 9
85 C0      test   eax, eax              ; quotient  == 0?
75 F4      jnz    CheckDigit            ; loop if more digits to check
           
89 33      mov    DWORD PTR [ebx], esi  ; store esi into scratch memory buffer
DB 03      fild   DWORD PTR [ebx]       ; push value from scratch memory buffer to top of x87
D9 E8      fld1                         ; push 1.0 to top of x87
DE F1      fdivrp st(1), st(0)          ; calculate 1.0 / esi
DE C1      faddp  st(1), st(0)          ; accumulate partial sum (result is at top of x87)
E2 E3      loop   PartialSum            ; decrement ecx (n), and continue looping if non-zero
C3         ret
```
---
# [BONUS:] x86 Machine Code (AVX), 44 bytes
```
31 F6 46 0F 57 C0 8D 7E 09 F3 0F 2A D6 4E 46 89 F0 99 F7 F7 83 FA
09 74 F5 85 C0 75 F4 C5 F2 2A CE C5 EA 5E C9 C5 FA 58 C1 E2 E3 C3
```
In ungolfed assembly language mnemonics:
```
             ; Computes the nth partial sum of the Kempner series.
             ; Input(s):
             ;   ecx = n
             ; Output(s):
             ;   xmm0 = nth partial sum
             ; Clobber(s):
             ;   eax, ecx, edx, esi, edi, xmm0, xmm1, xmm2, flags
             Kempner:
31 F6          xor       esi,  esi             ; \ set ESI to 1
46             inc       esi                   ; /
0F 57 C0       xorps     xmm0, xmm0            ; zero XMM0
8D 7E 09       lea       edi,  [esi + 9]       ; set EDI to 10
F3 0F 2A D6    cvtsi2ss  xmm2,  esi            ; set XMM2 to 1 (from ESI)
4E             dec       esi                   ; set ESI back to 0
             PartialSum:                         
46             inc       esi
89 F0          mov       eax,  esi
             CheckDigit:                         
99             cdq       
F7 F7          div       edi
83 FA 09       cmp       edx,  9
74 F5          je        PartialSum
85 C0          test      eax,  eax
75 F4          jne       CheckDigit
C5 F2 2A CE    vcvtsi2ss xmm1, xmm1, esi
C5 EA 5E C9    vdivss    xmm1, xmm2, xmm1
C5 FA 58 C1    vaddss    xmm0, xmm0, xmm1
E2 E3          loop      PartialSum
C3             ret
```
This is larger, since the AVX instructions require more bytes to encode than the x87 instructions. It is essentially the direct translation of the above function targeting the x87 FPU, except that I had to be a bit clever when loading "1.0" in the AVX (`xmm2`) register. Basically, I eagerly set `esi` to 1, load it into `xmm2` using the convert-from-integer instruction, and then set `esi` back to 0. Since `inc` and `dec` are 1-byte instructions, this is the cheapest way that I could find.
[Answer]
# [Zsh](https://www.zsh.org/) `-o forcefloat`, ~~41~~ 40 bytes
```
for ((;++n;))((n[(I)9]))||echo $[a+=1/n]
```
[Try it online!](https://tio.run/##qyrO@F@cWpJfUKKQll@UnBqflpOfWMJV/R/IU9DQsNbWzrPW1NTQyIvW8NS0jNXUrKlJTc7IV1CJTtS2NdTPi/1fW5ORmpiioGto9N/QCAA "Zsh – Try It Online")
Outputs infinitely.
Explanation:
```
for ((;++n;))((n[(I)9]))||echo $[a+=1/n]
                                           implicitly intitialise $n and $a to 0
for ((;   ;))                              loop while
       ++n                                  increment $n (always truthy)
                        ||                   if not
               n[(I)9]                        the index of "9" in $n
             ((       ))                       is not zero,
                               $[a+=   ]      then increase $a by
                                    1/n        the reciprocal of $n
                          echo                and print $a
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `s`, 39 bits1, 4.875 [bytes](https://github.com/Vyxal/Vyncode/blob/main/README.md)
```
9c¬)ȯĖ
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=1#WyJz4biLPSIsIiIsIjljwqwpyK/EliIsIiIsIjEwIl0=)
1-indexed.
## Explained
```
9c¬)ȯĖ
   )ȯ  # First #input numbers which:
 c¬    #    don't contain
9      #    the number 9
     Ė # reciprocals
# summed by the s flag
```
]