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.

Previous Showing 11-18 of 18 results.

A376759 Number of composite numbers c with n < c <= 2*n.

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 5, 6, 6, 6, 8, 8, 10, 11, 11, 11, 13, 14, 15, 16, 16, 16, 18, 18, 19, 20, 20, 21, 23, 23, 24, 25, 26, 26, 27, 27, 28, 29, 30, 30, 32, 32, 34, 35, 35, 36, 38, 39, 39, 40, 40, 40, 42, 42, 42, 43, 43, 44, 46, 47, 49, 50, 51, 51, 52, 52, 54, 55, 55, 55, 57, 58, 60, 61, 61, 61, 62, 63, 64, 65, 66, 66, 68, 68, 69, 70, 70, 71, 73, 73, 73, 74, 75, 76, 77, 77
Offset: 1

Views

Author

N. J. A. Sloane, Oct 20 2024

Keywords

Comments

This completes the set of four: A307912, A376759, A307989, and A075084. Since it is not clear which ones are the most important, and they are easily confused, all four are now in the OEIS.

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
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.
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.

Programs

  • Maple
    chi := proc(n) if n <= 3 then 0 else n - numtheory:-pi(n) - 1; fi; end; # A065855
    A376759 := proc(n) chi(2*n) - chi(n); end;
    a := [seq(A376759(n),n=1..120)];
  • Mathematica
    Table[PrimePi[n] - PrimePi[2*n] + n, {n, 100}] (* Paolo Xausa, Oct 22 2024 *)
  • Python
    from sympy import primepi
    def A376759(n): return n+primepi(n)-primepi(n<<1) # Chai Wah Wu, Oct 20 2024

Formula

a(n) = A000720(n) - A000720(2*n) + n. - Paolo Xausa, Oct 22 2024

A246514 Number of composite numbers between prime(n) and 2*prime(n) exclusive.

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 12, 14, 17, 22, 23, 27, 31, 33, 37, 41, 45, 48, 53, 56, 59, 63, 67, 72, 77, 80, 83, 87, 90, 94, 103, 107, 111, 113, 121, 124, 128, 134, 138, 144, 148, 150, 158, 160, 164, 166, 175, 184, 188, 190, 193, 199, 201, 209, 214, 219, 226, 228, 234
Offset: 1

Views

Author

Odimar Fabeny, Aug 28 2014

Keywords

Examples

			2 P 4 = 0,
3 4 P 6 = 1,
5 6 P 8 9 10 = 3,
7 8 9 10 P 12 P 14 = 4,
11 12 P 14 15 16 P 18 P 20 21 22 = 7
and so on.
		

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
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.
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.

Programs

  • Maple
    A246515 := proc(n) local p;  p:=ithprime(n); n - 1 + p - numtheory:-pi(2*p - 1); end; # N. J. A. Sloane, Oct 20 2024
    [seq(A246515(n),n=1..120)];
  • Mathematica
    Table[Prime[n] - PrimePi[2*Prime[n]] + n - 1, {n, 100}] (* Paolo Xausa, Oct 22 2024 *)
  • PARI
    s=[]; forprime(p=2, 1000, n=0; for(q=p+1, 2*p-1, if(!isprime(q), n++)); s=concat(s, n)); s \\ Colin Barker, Aug 28 2014
    
  • PARI
    a(n)=prime(n)+n-1-primepi(2*prime(n))
    vector(100, n, a(n)) \\ Faster program. Jens Kruse Andersen, Aug 28 2014
    
  • Python
    from sympy import prime, primepi
    def A246514(n): return (m:=prime(n))+n-1-primepi(m<<1) # Chai Wah Wu, Oct 22 2024

Formula

a(n) + A070046(n) = number of numbers between prime(n) and 2*prime(n), which is prime(n)-1. - N. J. A. Sloane, Aug 28 2014

Extensions

More terms from Colin Barker, Aug 28 2014

A307912 a(n) = n - 1 - pi(2*n-1) + pi(n), where pi is the prime counting function.

Original entry on oeis.org

0, 0, 1, 1, 3, 3, 4, 5, 5, 5, 7, 7, 9, 10, 10, 10, 12, 13, 14, 15, 15, 15, 17, 17, 18, 19, 19, 20, 22, 22, 23, 24, 25, 25, 26, 26, 27, 28, 29, 29, 31, 31, 33, 34, 34, 35, 37, 38, 38, 39, 39, 39, 41, 41, 41, 42, 42, 43, 45, 46, 48, 49, 50, 50, 51, 51, 53, 54
Offset: 1

Views

Author

Wesley Ivan Hurt, May 09 2019

Keywords

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.

Examples

			a(7) = 4; there are 4 composites in the closed interval [8, 13]: 8, 9, 10 and 12.
		

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
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.
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.

Programs

  • 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}]
  • Python
    from sympy import primepi
    def A307912(n): return n+primepi(n)-primepi((n<<1)-1)-1 # Chai Wah Wu, Oct 20 2024

Formula

a(n) = n - 1 - A060715(n).
a(n) = n - 1 - A000720(2*n-1) + A000720(n).

A307989 a(n) = n - pi(2*n) + pi(n-1), where pi is the prime counting function.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 4, 6, 6, 6, 7, 8, 9, 11, 11, 11, 12, 14, 14, 16, 16, 16, 17, 18, 19, 20, 20, 21, 22, 23, 23, 25, 26, 26, 27, 27, 27, 29, 30, 30, 31, 32, 33, 35, 35, 36, 37, 39, 39, 40, 40, 40, 41, 42, 42, 43, 43, 44, 45, 47, 48, 50, 51, 51, 52, 52, 53, 55
Offset: 1

Views

Author

Wesley Ivan Hurt, May 09 2019

Keywords

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.

Examples

			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.
		

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
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.
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.

Programs

  • Maple
    chi := proc(n) if n <= 3 then 0 else n - numtheory:-pi(n) - 1; fi; end; # A065855
    A307989 := proc(n) chi(2*n-1) - chi(n-1); end;
    a := [seq(A307989(n),n=1..120)];
  • Mathematica
    Table[n - PrimePi[2 n] + PrimePi[n - 1], {n, 100}]
  • Python
    from sympy import primepi
    def A307989(n): return n+primepi(n-1)-primepi(n<<1) # Chai Wah Wu, Oct 20 2024

Formula

a(n) = n - A035250(n).
a(n) = n - A000720(2*n) + A000720(n-1).

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 22 2024

Keywords

Comments

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.

Examples

			The 5th composite number is 10, and 10, 12, 14, 15, 16, 18, 20 are composite, so a(5) = 7.
		

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
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.
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.

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

Formula

a(n) = 2*A002808(n) - A000720(2*A002808(n)) - n. - Paolo Xausa, Oct 22 2024

A376761 Number of primes between the n-th composite number c(n) and 2*c(n).

Original entry on oeis.org

2, 2, 2, 3, 4, 4, 3, 4, 5, 4, 4, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9, 10, 10, 9, 10, 10, 9, 10, 10, 11, 12, 12, 13, 13, 14, 14, 13, 12, 12, 13, 13, 14, 13, 14, 15, 14, 13, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 18, 19, 19, 20, 21, 20, 19, 19, 20, 19, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 23, 23, 23, 23, 23, 24, 23, 24, 24, 24, 24, 24, 25
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2024

Keywords

Comments

Obviously the endpoints are not counted (since they are composite).

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
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.
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.

Programs

  • Mathematica
    MapIndexed[PrimePi[2*#] + #2[[1]] - # + 1 &, Select[Range[100], CompositeQ]] (* Paolo Xausa, Oct 22 2024 *)
  • Python
    from sympy import composite, primepi
    def A376761(n): return n+1-(m:=composite(n))+primepi(m<<1) # Chai Wah Wu, Oct 22 2024

Formula

a(n) = A000720(2*A002808(n)) - A002808(n) + n + 1. - Paolo Xausa, Oct 22 2024

A114021 Number of semiprimes between n and n + sqrt(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 1, 2, 3, 3, 3, 3, 3, 2, 2, 2, 1, 0, 1, 1, 1, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 4, 3, 3, 2, 1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2
Offset: 0

Views

Author

Jonathan Vos Post, Jan 31 2006

Keywords

Comments

It appears that for n > 37 it is always true that a(n) > 0. The exponent can be reduced further. Since 597 + 597^(0.4129) > 611, leaping the record semiprime gap between 597 and 611, it seems that for n > 597 it is always true that there is a semiprime between n and n^(0.4129). It seems that for n > 2705 it is always true that there is a semiprime between n and n^(0.3509). These conjectures are related to the various sequences about semiprime gaps and the merit of such gaps.
a(96) appears to be the last zero term. - T. D. Noe, Aug 12 2008

Examples

			a(0) = 0 because there are no semiprimes between 0 and 0+sqrt(0) = 0.
a(2) = 0 because there are no semiprimes between 2 and 2+sqrt(2) = 3.414...
a(3) = 1 as the semiprime 4 falls between 3 and 3 + sqrt(3) = 4.732...
a(5) = 1 as the semiprime 6 falls between 5 and 5 + sqrt(5) = 7.236...
		

Crossrefs

Programs

  • Mathematica
    SemiPrimeQ[n_] := TrueQ[Plus@@Last/@FactorInteger[n]==2]; Table[hi=n+Sqrt[n]; If[IntegerQ[hi], hi--, hi=Floor[hi]]; Length[Select[Range[n+1,hi], SemiPrimeQ]], {n,0,150}] (* T. D. Noe, Aug 12 2008 *)
  • Perl
    use ntheory ":all"; print "$ ",semiprime_count($+1, $+sqrtint($)-($ && is_square($))),"\n" for 0..1000; # Dana Jacobsen, Mar 04 2019

Formula

a(n) = card{S such that S is an element of A001358 and n < S < n + n^(1/2)}.

Extensions

Corrected and extended by T. D. Noe, Aug 12 2008

A113971 Number of semiprimes from n to (4/3)*n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 3, 4, 4, 3, 2, 2, 3, 3, 3, 3, 4, 5, 5, 5, 5, 4, 4, 3, 4, 4, 4, 3, 3, 4, 5, 6, 6, 5, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5
Offset: 1

Views

Author

Jonathan Vos Post, Jan 31 2006

Keywords

Comments

a(n) > 0 for all n > 2. a(n) > 1 for all n > 16. This is a semiprime (A001358) related sequence similar to the prime related Bertrand's postulate [1845] that, for n > 1, there is always at least one prime p such that n < p < 2*n. A060715 is the number of primes between n and 2n. A077463 is the number of primes between n and 2n-2.

Examples

			a(1) = 0 because there is no semiprime from 1 through 4/3 = 1.3333...
a(2) = 0 because there is no semiprime from 2 through 8/3 = 2.6666...
a(3) = 1 because there is the semiprime 4 from 3 through 12/3 = 4.
		

Crossrefs

Formula

a(n) = card{S such that S is an element of A001358 and n <= S <= 4*n/3}.
Previous Showing 11-18 of 18 results.