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-16 of 16 results.

A077463 Number of primes p such that n < p < 2n-2.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 9, 9, 9, 10, 10, 11, 11, 11, 12, 13, 13, 14, 13, 13, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 13, 13, 13, 14, 15, 15, 14, 15, 15, 15, 15, 15
Offset: 1

Views

Author

Eric W. Weisstein, Nov 05 2002

Keywords

Comments

a(n) > 0 for n > 3 by Bertrand's postulate (and Chebyshev's proof of 1852). - Jonathan Vos Post, Aug 08 2013

Examples

			a(19) = 3, the first value smaller than a previous value, because the only primes between 19 and 2 * 19 - 2 = 36 are {23,29,31}. - _Jonathan Vos Post_, Aug 08 2013
		

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
    a[n_] := PrimePi[2n - 2] - PrimePi[n]; a[1] = 0; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Oct 31 2012 *)

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
Previous Showing 11-16 of 16 results.