A376760 Let c(n) = A002808(n) denote the n-th composite number; a(n) = number of composite numbers c with c(n) <= c <= 2*c(n).
3, 5, 7, 7, 7, 9, 12, 12, 12, 15, 17, 17, 17, 19, 20, 21, 21, 22, 24, 26, 27, 27, 28, 28, 30, 31, 31, 33, 36, 36, 37, 40, 40, 41, 41, 41, 43, 43, 44, 44, 45, 48, 51, 52, 52, 53, 53, 56, 56, 56, 59, 62, 62, 62, 63, 64, 66, 67, 67, 69, 70, 71, 71, 72, 74, 74, 75, 76, 77, 78, 78, 80, 80, 80, 83, 86, 87, 87, 90, 93, 94, 94, 96, 96, 97, 97, 98, 99, 99, 99, 100, 101, 102, 103
Offset: 1
Keywords
Examples
The 5th composite number is 10, and 10, 12, 14, 15, 16, 18, 20 are composite, so a(5) = 7.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..20000
Crossrefs
Programs
-
Maple
chi := proc(n) if n <= 3 then 0 else n - numtheory:-pi(n) - 1; fi; end; # A065855 t := []: for n from 2 to 200000 do if not isprime(n) then t := [op(t), n]; fi; od: # precompute A002808 ithchi := proc(n) t[n]; end: # returns n-th composite number A002808 for any n <= 182015, analogous to ithprime A376760 := proc(n) chi(2*ithchi(n)) - n + 1; end; [seq(A376760(n),n=1..120)];
-
Mathematica
MapIndexed[2*# - PrimePi[2*#] - #2[[1]] &, Select[Range[100], CompositeQ]] (* Paolo Xausa, Oct 22 2024 *)
-
Python
from sympy import composite, primepi def A376760(n): return (m:=composite(n)<<1)-primepi(m)-n # Chai Wah Wu, Oct 22 2024
Comments