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

A087010 Number of primes of form 4*k+1 between n and 2n (inclusive).

Original entry on oeis.org

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

Views

Author

Jason Earls, Jul 30 2003

Keywords

Comments

Erdős proved that between any n > 7 and its double there are always at least two primes, one of form 4*k+1 and one of form 4*k+3.

References

  • B. Schechter, "My Brain is Open: The Mathematical Journeys of Paul Erdős," Simon & Schuster, New York, 1998, p. 62.

Crossrefs

Programs

  • Magma
    [#[p:p in PrimesInInterval(n,2*n)| p mod 4 eq 1]:n in [1..110]]; // Marius A. Burtea, Dec 16 2019
  • Mathematica
    a[n_] := Module[{c = 0}, Do[If[Mod[k, 4] == 1 && PrimeQ[k], c++], {k, n, 2 n}]; c]; Array[a, 100] (* Amiram Eldar, Dec 16 2019 *)

A087011 Number of primes of form 4*k+3 between n and 2n (inclusive).

Original entry on oeis.org

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

Views

Author

Jason Earls, Jul 30 2003

Keywords

Comments

Erdős proved that between any n > 7 and its double there are always at least two primes, one of form 4*k+1 and one of form 4*k+3.

References

  • B. Schechter, "My Brain is Open: The Mathematical Journeys of Paul Erdős," Simon & Schuster, New York, 1998, p. 62.

Crossrefs

Programs

  • Magma
    [#[p:p in PrimesInInterval(n,2*n)| p mod 4 eq 3]:n in [1..100]]; // Marius A. Burtea, Dec 16 2019
  • Mathematica
    a[n_] := Module[{c = 0}, Do[If[Mod[k, 4] == 3 && PrimeQ[k], c++], {k, n, 2 n}]; c]; Array[a, 100] (* Amiram Eldar, Dec 16 2019 *)

A087012 Numbers m such that the number of primes of form 4*k+1 between m and 2*m equals the number of primes of form 4*k+3 between m and 2*m (inclusive).

Original entry on oeis.org

1, 3, 4, 5, 8, 10, 11, 12, 13, 15, 20, 22, 23, 24, 25, 26, 31, 34, 35, 37, 49, 50, 52, 53, 57, 58, 59, 62, 63, 69, 72, 73, 75, 79, 82, 83, 84, 85, 86, 91, 92, 93, 94, 95, 97, 99, 141, 147, 148, 149, 152, 153, 164, 165, 168, 175, 176, 182, 183, 187, 188, 189, 200, 244, 245
Offset: 1

Views

Author

Jason Earls, Jul 30 2003

Keywords

Crossrefs

Programs

  • Magma
    f:=func; [k:k in [1..250]|f(k,1) eq f(k,3)]; // Marius A. Burtea, Dec 16 2019
  • Mathematica
    seqQ[n_] := Module[{c1 = 0, c3 = 0}, Do[If[Mod[k, 4] == 1 && PrimeQ[k], c1++]; If[Mod[k, 4] == 3 && PrimeQ[k], c3++], {k, n, 2 n}]; c1 == c3]; Select[Range[250], seqQ] (* Amiram Eldar, Dec 16 2019 *)
    npfQ[n_]:=With[{prs=Select[Range[n,2n],PrimeQ]},Length[Select[prs,Mod[#,4]==1&]]==Length[Select[prs,Mod[#,4]==3&]]]; Select[ Range[ 250],npfQ] (* Harvey P. Dale, Sep 25 2024 *)
  • PARI
    for(m=1,250,my(k1=0,k3=0);forprime(p=m,2*m,if(p%4==1,k1++);if(p%4==3,k3++));if(k1==k3,print1(m," "))) \\ Hugo Pfoertner, Dec 16 2019
    

A088018 Number of twin-prime pairs between n and 2n (inclusive).

Original entry on oeis.org

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

Views

Author

T. D. Noe, Sep 18 2003, Feb 17 2011

Keywords

Comments

To be counted, both members of the twin-prime pair must be between n and 2n, inclusive. It appears that a(n) > 0 for all n > 6. However, it has not been proved that there are an infinite number of twin primes.
Same as the number of lower twin primes between n-1 and 2(n-1), exclusive. If the twin prime conjecture is true, there are at least n lower twin primes between x/2 and x for all x >= A186312(n).

Crossrefs

Cf. A035250 (number of primes between n and 2n), A088019 (number of twin primes between n and 2n).

Programs

  • Mathematica
    nn=100; p=Select[Prime[Range[PrimePi[2*nn]]], PrimeQ[#+2] &]; t=Table[0, {nn}]; Do[t[[Span[Ceiling[i/2], Min[nn,i-1]]]]++, {i, p}]; Prepend[t,0]
    Table[Total[Length /@ Split[Select[Range[n, 2 n], PrimeQ], #2 - #1 == 2 &] - 1], {n, 105}] (* Jayanta Basu, Aug 12 2013 *)

A088019 Number of twin primes between n and 2n (inclusive).

Original entry on oeis.org

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

Views

Author

T. D. Noe, Sep 18 2003

Keywords

Comments

Here a twin prime is counted even if only one member of the twin-prime pair is between n and 2n, inclusive. Note that this sequence is very close to 2*A088018. It appears that a(n) > 0 for all n > 1. However, it has not been proved that there are an infinite number of twin primes.

Crossrefs

Cf. A035250 (number of primes between n and 2n), A088018 (number of twin-prime pairs between n and 2n).

Programs

  • Mathematica
    pl=Prime[Range[PrimePi[20000]]]; twl={}; Do[If[pl[[i-1]]+2==pl[[i]], twl=Join[twl, {pl[[i-1]], pl[[i]]}]], {i, 2, Length[pl]}]; twl=Union[twl]; i1=1; i2=1; nMin=(twl[[1]]-1)/2; nMax=(twl[[ -1]]+1)/2; Join[Table[0, {nMin-1}], Table[While[twl[[i1]]
    				

A352777 a(n) = Sum_{p <= n <= q < 2n, p,q prime} (p * q).

Original entry on oeis.org

0, 10, 40, 60, 120, 180, 527, 408, 697, 1020, 1680, 2016, 2952, 2419, 3608, 4879, 6902, 5916, 10703, 9240, 12397, 15708, 20400, 22800, 22800, 22800, 28100, 28100, 36249, 40119, 59520, 54560, 54560, 65280, 65280, 76640, 108744, 101455, 101455, 117018, 141372, 151368, 178716
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 02 2022

Keywords

Comments

Total area of all unique p X q rectangles with p,q prime such that p <= n <= q < 2n.

Examples

			a(5) = 120; the 6 unique p X q rectangles, with p,q prime such that p <= 5 <= q < 10 are: 2 X 5, 2 X 7, 3 X 5, 3 X 7, 5 X 5, and 5 X 7. The total area of all rectangles is 2*5 + 2*7 + 3*5 + 3*7 + 5*5 + 5*7 = 120.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Sum[k (2 n - i) (PrimePi[k] - PrimePi[k - 1]) (PrimePi[2 n - i] - PrimePi[2 n - i - 1]), {k, n}], {i, n}], {n, 100}]

A143537 Triangle read by rows: T(n,k) = number of primes in the interval [k..n], n >= 1, 1 <= k <= n.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Aug 23 2008

Keywords

Comments

Old name: triangle read by rows, A000012 * A143536, 1<=k<=n.

Examples

			Triangle T(n,k) begins:
n\k 1  2  3  4  5  6  7  8 ...
1:  0;
2:  1, 1;
3:  2, 2, 1;
4:  2, 2, 1, 0;
5:  3, 3, 2, 1, 1;
6:  3, 3, 2, 1, 1, 0;
7:  4, 4, 3, 2, 2, 1, 1;
8:  4, 4, 3, 2, 2, 1, 1, 0;
...
		

Crossrefs

Row sums are A034387.
Column k=1 gives A000720.
Main diagonal gives A010051.
T(2n,n) gives A035250.
Cf. A143536.

Formula

T(n,k) = pi(n) - pi(k-1), where pi = A000720. - Ilya Gutkovskiy, Mar 19 2020

Extensions

New name and corrected by Ilya Gutkovskiy, Mar 19 2020

A220850 a(n+1) is equal to a(n) plus the number of primes between a(n) and 2*a(n) inclusively.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 14, 17, 22, 28, 35, 43, 53, 65, 78, 93, 111, 129, 153, 179, 210, 245, 285, 328, 381, 441, 508, 582, 668, 764, 870, 990, 1123, 1270, 1436, 1625, 1825, 2054, 2309, 2590, 2904, 3246, 3631, 4052, 4512, 5022, 5582, 6197, 6872, 7612, 8421, 9312
Offset: 1

Views

Author

Robert G. Wilson v, Dec 22 2012

Keywords

Examples

			a(6) = the number of primes between a(5) and 2*a(5) plus a(5) = the number of primes [8, 16] + 8 = 2 + 8 = 10.
		

Crossrefs

Cf. A035250, A220851, inspired by A084140.

Programs

  • Mathematica
    f[n_] := PrimePi[ 2n] - PrimePi[n - 1]; NestList[# +f@# &, 1, 50]

A226983 a(n) = ceiling(n/2) - pi(2n) + pi(n-1).

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Jun 25 2013

Keywords

Comments

The number of partitions of 2n into exactly two parts such that the first part is an odd composite integer, n > 2.

Crossrefs

Programs

  • Maple
    with(numtheory); seq(ceil(k/2)-(pi(2*k)-pi(k-1)),k=1..100);
  • Mathematica
    Table[Floor[(n + 1) / 2] - (PrimePi[2 n] - PrimePi[n - 1]), {n, 100}] (* Vincenzo Librandi, Dec 07 2016 *)
  • PARI
    a226983(n) = if(n==1, 0, ceil(n/2) - primepi(2*n) + primepi(n-1)) \\ Michael B. Porter, Jun 29 2013

Formula

a(n) = floor((n+1)/2) - ( pi(2n) - pi(n-1) ) = A004526(n+1) - A035250(n).

A284437 Number of primes between n and 2^n inclusive.

Original entry on oeis.org

0, 1, 2, 3, 4, 9, 15, 28, 50, 93, 168, 305, 559, 1023, 1894, 3506, 6536, 12245, 22993, 43383, 82017, 155603, 295939, 564155, 1077862, 2063680, 3957800, 7603544, 14630834, 28192741, 54400018, 105097555, 203280210, 393615795, 762939100, 1480206268, 2874398504, 5586502337
Offset: 0

Views

Author

Vincenzo Librandi, Mar 27 2017

Keywords

Examples

			a(0) = 0 because there are 0 primes between 0 and 2^0.
a(5) = 9 because there are 9 primes between 5 and 2^5: 5, 7, 11, 13, 17, 19, 23, 29, 31 (we count the boundary of the interval in this case).
		

Crossrefs

Programs

  • Magma
    [0] cat [#PrimesInInterval(n, 2^n): n in [1..28]];
  • Mathematica
    Join[{0}, f[n_]:=PrimePi[2^n] - PrimePi[n-1]; Array[f, 37]]

Formula

a(n) = A284275(n) + A080339(n) for n >= 1. - Amiram Eldar, Jun 11 2024
Previous Showing 31-40 of 46 results. Next