OFFSET
1,4
COMMENTS
a(n) is the number of composites in the closed interval [n, 2n-1].
a(n) is also the number of composites among the largest parts of the partitions of 2n into two parts.
LINKS
EXAMPLE
a(7) = 4; There are 7 partitions of 2*7 = 14 into two parts (13,1), (12,2), (11,3), (10,4), (9,5), (8,6), (7,7). Among the largest parts 12, 10, 9 and 8 are composite, so a(7) = 4.
MAPLE
MATHEMATICA
Table[n - PrimePi[2 n] + PrimePi[n - 1], {n, 100}]
PROG
(Python)
from sympy import primepi
def A307989(n): return n+primepi(n-1)-primepi(n<<1) # Chai Wah Wu, Oct 20 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, May 09 2019
STATUS
approved