For an alphabet size `A` (any int), an actual Fenwick Tree needs only `n = ceil(log_2(A))` array slots. If `A` is a power of two they need no extra memory over a simple histogram. Your `fenwicktree.newSampler` uses `2*n-1` (for that same `n`). And it's not some +-0/1-origin indexing threshold thing, but a legit 2x through the whole last power of 2. So, we don't disagree on what you use, but on what you _could_ use.
That (admittedly confusing) paper even says "In fact, Fenwick Tree can be regarded as a compressed version of the F+ tree" (which itself kind of exhibits their terminological weirdness). It is to this "compressed" that I refer. If you don't want to think about it for a year that's ok. It is pretty far off topic. There are even further off topic things like [https://arxiv.org/pdf/1612.09083.pdf](https://arxiv.org/pdf/1612.09083.pdf) that warrants a mention for the curious.
