This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A075084 #29 Oct 22 2024 02:57:40 %S A075084 0,1,2,3,4,5,5,7,7,7,8,9,10,12,12,12,13,15,15,17,17,17,18,19,20,21,21, %T A075084 22,23,24,24,26,27,27,28,28,28,30,31,31,32,33,34,36,36,37,38,40,40,41, %U A075084 41,41,42,43,43,44,44,45,46,48,49,51,52,52,53,53,54,56,56,56,57,59,60 %N A075084 Number of composite numbers c with n <= c <= 2*n. %C A075084 The number of composite numbers <= n is n less the number of primes less 1. %C A075084 The sequence is nondecreasing. %H A075084 N. J. A. Sloane, <a href="/A075084/b075084.txt">Table of n, a(n) for n = 1..20000</a> %F A075084 a(n) = n - pi(2n) + pi(n-1) + 1, for n>1. %e A075084 a(8) = 7: the composite numbers are 8,9,10,12,14,15 and 16. %p A075084 chi := proc(n) if n <= 3 then 0 else n - numtheory:-pi(n) - 1; fi; end; # A065855 %p A075084 A075084 := proc(n) chi(2*n) - chi(n-1); end; %p A075084 a := [seq(A075084(n),n=1..120)]; # _N. J. A. Sloane_, Oct 20 2024 %t A075084 Table[n - PrimePi[2n] + PrimePi[n - 1] + 1, {n, 2, 75}] %o A075084 (Python) %o A075084 from sympy import primepi %o A075084 def A075084(n): return n+primepi(n-1)-primepi(n<<1)+1 if n>1 else 0 # _Chai Wah Wu_, Oct 20 2024 %o A075084 (PARI) a(n) = if (n>1, n - primepi(2*n) + primepi(n-1) + 1, 0); \\ _Michel Marcus_, Oct 21 2024 %Y A075084 Related sequences: %Y A075084 Primes (p) and composites (c): A000040, A002808, A000720, A065855. %Y A075084 Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954. %Y A075084 Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759. %K A075084 easy,nonn %O A075084 1,3 %A A075084 _Amarnath Murthy_, Sep 11 2002 %E A075084 Edited by _Robert G. Wilson v_, Sep 12 2002 %E A075084 Definition clarified by _N. J. A. Sloane_, Oct 20 2024