OFFSET
1,5
COMMENTS
The definition is due to Jack Brennen.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Kevin Ryde, Piecewise-Linear Above Cumulative Primes (and LaTeX+PGF source)
EXAMPLE
We want to produce prime numbers out of nondecreasing "blocks" of powers of 2. Each time we use one block in addition to the remains of the previous block. To get 2, we need a block of 2. So a(1) = 2-2 = 0. To get 3, we need a block of 4. So a(2) = 4-3 = 1. To get 5, we need a block of 4 in addition to the remains of the previous block. So a(3) = 4+1-5 = 0.
PROG
(PARI) accum=0; inc=2; forprime(p=2, 99, while(accum+inc<p, inc*=2); accum+=inc-p; print(accum)); \\ Jack Brennen, Jan 28 2021
(PARI) m=d=0; [ d+=2<<exponent(m=max(p-d-1, m))-p | p<-primes(50)] \\ M. F. Hasler, Jan 30 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ali Sada, Apr 24 2021
STATUS
approved