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-20 of 46 results. Next

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

A185636 a(n) = |{0 <= k < n: n+k and n+k^2 are both prime}|.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Dec 18 2012

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.
This conjecture has been verified for n up to 10^8. It is stronger than Bertrand's postulate proved by Chebyshev in 1850.
Zhi-Wei Sun also guessed the following refinement of the conjecture: For any integer n > 1456 there is an integer k among 0,...,n-1 such that n-k, n+k and n+k^2 are all prime; in other words, there is a prime p <= n such that 2n-p and n+(n-p)^2 are both prime.
For other refinements of the conjecture, the reader may consult arXiv:1211.1588.
The author also conjectured the following polynomial analogs:
(i) For a given integer polynomial f(x) of degree n > 0, there is an integer polynomial g(x) of degree at most n such that f(x)+g(x) and f(x)+g(x)^2 are both irreducible in Z[x].
(ii) Let F be a field with characteristic different from 2 and 3. If f(x) is an irreducible polynomial over F with degree n > 0, then there is a polynomial g(x) over F with deg(g) <= n such that f(x)+g(x)^2 is irreducible over F.
In a 2017 paper, the author announced a USD $100 prize for the first solution to his conjecture that for each n = 1,2,3,... there is an integer k among 0,...,n such that n+k and n+k^2 are both prime. - Zhi-Wei Sun, Dec 03 2017

Examples

			a(14)=1 since 3 is the only k among 0,...,13 with 14+k and 14+k^2 both prime.
		

Crossrefs

Cf. A035250.

Programs

A179211 Number of squarefree numbers between n and 2*n (inclusive).

Original entry on oeis.org

2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 8, 9, 8, 9, 9, 11, 11, 13, 13, 15, 15, 15, 15, 15, 16, 16, 17, 19, 19, 20, 19, 21, 21, 22, 22, 24, 23, 24, 24, 25, 25, 26, 26, 27, 28, 29, 29, 30, 30, 32, 32, 34, 34, 36, 36, 38, 38, 38, 38, 39, 39, 38, 39, 41, 41, 42, 41, 43, 43, 44, 44, 46, 45, 45
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 05 2010

Keywords

Crossrefs

Programs

  • Maple
    a := n -> nops(select(issqrfree, [$n..(2*n)])):
    seq(a(n), n=1..75); # Peter Luschny, Mar 02 2017
  • Mathematica
    a[n_] := Select[Range[n, 2n], SquareFreeQ] // Length;
    Array[a, 75] (* Jean-François Alcover, Jun 22 2018 *)
  • PARI
    f(n)=my(s); forfactored(k=1,sqrtint(n), s += n\k[1]^2*moebius(k)); s
    a(n)=f(2*n)-f(n-1) \\ Charles R Greathouse IV, Nov 05 2017

Formula

a(n) = Sum_{k=n..2*n} A008966(k).
a(n) > A035250(n) for n>2;
A179212(n) = a(n+1) - a(n);
a(n) = A013928(2*n+1) - A013928(n).
a(n) ~ (6/Pi^2) * n. - Amiram Eldar, Mar 03 2021

A289493 Number of primes in the interval [2n, 3n].

Original entry on oeis.org

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

Views

Author

FUNG Cheok Yin, Jul 07 2017

Keywords

Crossrefs

Cf. A000720 (PrimePi), A101985 (numbers occurring here exactly once).

Programs

Formula

a(n) = A000720(3n) - A000720(2n), for n > 1. - M. F. Hasler, Sep 29 2019

A289494 Number of primes in the interval [3n, 4n].

Original entry on oeis.org

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

Views

Author

FUNG Cheok Yin, Jul 07 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Join[{1},Rest[Table[PrimePi[4n]-PrimePi[3n],{n,80}]]] (* Harvey P. Dale, Dec 30 2024 *)
Previous Showing 11-20 of 46 results. Next