Is this sequence somehow connected to Fermat's Little Theorem?
A few years ago I introduced sequence A338699 to the OEIS:
**A338699**: "Let sequence A be the prime numbers. Let sequence B be the lexicographically smallest nondecreasing sequence of powers of 2 whose partial sums are at least as large as the corresponding partial sums of the primes. Then a(n) is the excess of the partial sum of B over the partial sum of the primes after n terms."
The graph appears remarkably smooth. I wonder whether this behavior has any connection with Fermat's Little Theorem, or whether it arises from a completely different phenomenon.
Incidentally, the graph looks essentially the same if powers of any other prime are used instead of powers of 2. #science