cp's OEIS Frontend

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.

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).

This page as a plain text file.
%I A376760 #33 Oct 22 2024 13:00:14
%S A376760 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,
%T A376760 31,31,33,36,36,37,40,40,41,41,41,43,43,44,44,45,48,51,52,52,53,53,56,
%U A376760 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
%N 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).
%C A376760 There are three other versions: composite c with c(n) < c < 2*c(n): a(n)-2; c(n) <= c < 2*c(n): a(n) - 1; and c(n) < c <= 2*c(n): also a(n) - 1.
%H A376760 N. J. A. Sloane, <a href="/A376760/b376760.txt">Table of n, a(n) for n = 1..20000</a>
%F A376760 a(n) = 2*A002808(n) - A000720(2*A002808(n)) - n. - _Paolo Xausa_, Oct 22 2024
%e A376760 The 5th composite number is 10, and 10, 12, 14, 15, 16, 18, 20 are composite, so a(5) = 7.
%p A376760 chi := proc(n) if n <= 3 then 0 else n - numtheory:-pi(n) - 1; fi; end; # A065855
%p A376760 t := []: for n from 2 to 200000 do if not isprime(n) then t := [op(t), n]; fi; od: # precompute A002808
%p A376760 ithchi := proc(n) t[n]; end: # returns n-th composite number A002808 for any n <= 182015, analogous to ithprime
%p A376760 A376760 := proc(n) chi(2*ithchi(n)) - n + 1; end;
%p A376760 [seq(A376760(n),n=1..120)];
%t A376760 MapIndexed[2*# - PrimePi[2*#] - #2[[1]] &, Select[Range[100], CompositeQ]] (* _Paolo Xausa_, Oct 22 2024 *)
%o A376760 (Python)
%o A376760 from sympy import composite, primepi
%o A376760 def A376760(n): return (m:=composite(n)<<1)-primepi(m)-n # _Chai Wah Wu_, Oct 22 2024
%Y A376760 Related sequences:
%Y A376760 Primes (p) and composites (c): A000040, A002808, A000720, A065855.
%Y A376760 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 A376760 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 A376760 nonn
%O A376760 1,1
%A A376760 _N. J. A. Sloane_, Oct 22 2024