Post History
BQN, 23 bytes {𝕩{𝕊⍟(𝕗>·+´∘÷1+↕)𝕩+1}1} This recursion is more complicated than it should, but I managed to keep it purely functional. I use a modifier to mimic passing a left argument, that's...
#1: Initial revision
# [BQN], 23 bytes {𝕩{𝕊⍟(𝕗>·+´∘÷1+↕)𝕩+1}1} This recursion is more complicated than it should, but I managed to keep it purely functional. I use a modifier to mimic passing a left argument, that's why we have the 𝕗 inside the recursion test. # [BQN], 17 bytes ⌊0.5+·⋆⊢-0.57722˙ I don't know if it is fair to use an approximation, but the harmonic series' partial sums are given by the Euler-Maclaurin formula, so we can do: $H_k \approx \ln k + \gamma > n$ So we solve for k and take the nearest integer. I have tuned the Euler–Mascheroni constant value so I can reproduce the recursion (although I hit CBQN's recursion limit for n=9 already): [BQN online REPL][Try] [BQN]: https://mlochbaum.github.io/BQN/ [Try]: https://mlochbaum.github.io/BQN/try.html#code=QSDihpAg4oyKMC41K8K34ouG4oqiLTAuNTc3MjLLmQpSIOKGkCB78J2VqXvwnZWK4o2fKPCdlZc+wrcrwrTiiJjDtzEr4oaVKfCdlakrMX0xfQoKKEHCqOKLiMK34oiowrTCtyhB4omhUinCqMKvM+KGk+KKoikgMSvihpUxMAo=