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 20 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

A376754 Length of n-th run of primes in A376198.

Original entry on oeis.org

2, 3, 4, 8, 13, 24, 43, 78, 142, 261, 479, 894, 1674, 3118, 5873, 11102, 20992, 39830, 75906, 144652, 276720, 529865, 1016535, 1954167, 3761091, 7250277, 13993031, 27042169, 52313384, 101320082, 196422988, 381154209, 740280217, 1438969498, 2799310690, 5449726356
Offset: 1

Views

Author

N. J. A. Sloane, Oct 03 2024

Keywords

Comments

Theorem: a(n) is the number of steps needed for the prime A376751(n) to "double" in the normal sequence of primes. More precisely, if A376751(n) = prime(j), then a(n) = A063124(j). For example, A376751(8) = 521 = prime(98), and A063124(98) = 78 = a(8). (The result seems to be off by 1 at n = 4, for reasons I don't understand yet.) - N. J. A. Sloane, Oct 04 2024

Crossrefs

Programs

Extensions

a(14)-a(33) from Michael S. Branicky, Oct 04 2024
a(34)-a(36) from Michael S. Branicky, Oct 07 2024

A378746 a(n) = Product{i=n..primepi(2*prime(n))} prime(i).

Original entry on oeis.org

6, 15, 35, 1001, 46189, 96577, 6678671, 14535931, 1348781387, 146078888479, 18128893780549, 203079283326684719, 433601713048867373, 877779077635511999, 1816798556036292277, 39006703653387621491281, 969956148531489825059765363, 16439934720872708899318057, 4483790064773102589474664169, 1274400211992152128527851190601
Offset: 1

Views

Author

Antti Karttunen, Dec 08 2024

Keywords

Comments

Each a(n) is a proper divisor of A007741(n).
Each a(n) or one of its proper divisors is present in A337372.
a(n) is the least product of consecutive primes starting from A000040(n) such that A003961(a(n)) > 2*a(n). Note that 6, 15, 35, 46189 and 96577 are all present in A337372, i.e., are primitively primeshift-abundant numbers. For 1001 = 7*11*31, it is however its proper divisor 91 = 7*31 which gets that honor.

Crossrefs

Subsequence of A097889.
Cf. also A378745.

Programs

  • PARI
    A378746(n) = prod(i=n,primepi(2*prime(n)),prime(i));

A124136 The list of primes p such that the number of primes in the open interval (p,2*p) is larger than the number of primes in the open interval (q,2*q) for all q

Original entry on oeis.org

2, 7, 11, 17, 23, 29, 31, 37, 53, 59, 71, 79, 89, 97, 101, 127, 137, 149, 157, 179, 191, 211, 223, 233, 251, 257, 263, 293, 307, 311, 331, 347, 367, 373, 379, 389, 409, 419, 431, 443, 457, 479, 487, 499, 521, 541, 547, 557, 563, 587, 599, 613, 617, 631, 641
Offset: 1

Views

Author

Jani Melik, Nov 30 2006

Keywords

Comments

Sequence A060715(n) lists the number of primes in the open interval (n,2*n).
If we extract its sublist for n a prime, the number of primes in the open interval (p,2*p), we have A070046(m) = 1, 1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 9, 9, 9, 9, 11, 13, 12, 13, 14, 13, 15, 15, 16... for the primes p=2, 3, 5, 7, 11, 13, 17, 19 etc.
This sequence lists the primes p = prime(m) that set a new record in A070046(m).
Alternative definition: primes p defined by positions of records in A063124.

Examples

			a(1)=prime(1)=2 with 1 prime in the interval (2,4). a(2) is neither 3 (with 1 prime in the interval (3,6)), nor 5 (with 1 prime in the interval (5,10)), but a(2)=7 with 2 primes in the interval (7,14).
The primes 41, 43 and 47 are not in the list because the intervals (41,82), (43,86) and (47,94) contain 9 primes, but the interval (37,74) with the smaller prime p=37 already contained 9 primes.
The prime 53 is in the list because the interval (53,106) contains 11 primes and the intervals (q,2*q) for primes q =2,3, 5, ..,47 contained 9 or less primes.
		

Crossrefs

Programs

  • Maple
    ts_c:=proc(n) local i,j,st_p,max_stp,ans; ans:= [ ]: st_p:=0: max_stp:=0: for i from 2 to n do for j from i+1 to 2*i-1 do if (isprime(j) = 'true') then st_p:=st_p+1: fi od: if (st_p > max_stp and isprime(i) = 'true') then max_stp := st_p: ans:=[ op(ans),i ]: fi; st_p:=0: od: RETURN(ans) end: ts_c(1200);

Extensions

Definition recovered from the Maple program. - R. J. Mathar, May 21 2025

A376764 Length of n-th region in A376198.

Original entry on oeis.org

3, 8, 15, 33, 63, 132, 260, 528, 1057, 2123, 4236, 8464, 16932, 33860, 67732, 135453, 270927, 541836, 1083716, 2167408, 4334796, 8669604, 17339208, 34678448, 69356872, 138713720, 277427448, 554854896, 1109709804, 2219419612, 4438839324, 8877678536, 17755357084, 35510714180, 71021428384, 142042856736
Offset: 1

Views

Author

N. J. A. Sloane, Oct 30 2024

Keywords

Comments

We define a region in A376198 to consist of a maximal string of non-prime terms followed by a string of prime terms.

Examples

			The first two regions in A376198 consist of terms 1 to 3 (of length a(1) = 3) and terms 4 to 11 (of length a(2) = 8).
		

Crossrefs

Formula

Apart from the initial 3, this is the first differences of A376752.
This is also, very approximately, the sum of A376763 and a subsequence of A063124.
Previous Showing 11-20 of 20 results.