OFFSET
1,5
COMMENTS
For n > 1, a(n) is the number of composites in the closed interval [n+1, 2n-1].
a(n) is also the number of composites appearing among the largest parts of the partitions of 2n into two distinct parts.
LINKS
EXAMPLE
a(7) = 4; there are 4 composites in the closed interval [8, 13]: 8, 9, 10 and 12.
MAPLE
chi := proc(n) if n <= 3 then 0 else n - numtheory:-pi(n) - 1; fi; end; # A065855
A307912 := proc(n) chi(2*n-1) - chi(n); end;
A := [seq(A307912(n), n=1..120)]; # N. J. A. Sloane, Oct 20 2024
MATHEMATICA
Table[n - 1 - PrimePi[2 n - 1] + PrimePi[n], {n, 100}]
PROG
(Python)
from sympy import primepi
def A307912(n): return n+primepi(n)-primepi((n<<1)-1)-1 # Chai Wah Wu, Oct 20 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, May 09 2019
STATUS
approved