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 41-50 of 108 results. Next

A086980 Late occurring prime gaps in the prime gap sequence A001223.

Original entry on oeis.org

12, 16, 32, 38, 46, 56, 66, 70, 74, 80, 88, 94, 102, 108, 116, 124, 134, 144, 150, 158, 166, 186, 194, 200, 228, 256, 264, 278, 294, 298, 316, 328, 334, 362, 370, 388, 422, 436, 442, 452, 466, 472, 482, 488, 510, 520, 536, 568, 576, 580, 590, 608, 628, 632
Offset: 1

Views

Author

Harry J. Smith, Jul 26 2003

Keywords

Comments

a(n) is the gap g = p_k+1 - p_k between consecutive primes with all even gaps smaller than g occurring at a smaller prime and the next even gap g+2 also occurring earlier.

Examples

			16 is in this list because the first time a prime gap of 16 occurs is between consecutive primes 1831 and 1847. All even prime gaps less than 16 occur for a smaller prime. The next even prime gap of 18 also occurs earlier.
		

References

  • P. Ribenboim, The Little Book of Big Primes. Springer-Verlag, 1991, p. 144.

Crossrefs

A087378 Smallest k such that both k-n and k+n are primes and there are no primes between them.

Original entry on oeis.org

2, 4, 9, 26, 93, 144, 205, 120, 1839, 532, 897, 1140, 1681, 2490, 2985, 4312, 5607, 1344, 9569, 30612, 19353, 16162, 15705, 81486, 28253, 31932, 19635, 35644, 82101, 44322, 43361, 34092, 89721, 162176, 134547, 173394, 31433, 404634, 212739
Offset: 0

Views

Author

Amarnath Murthy, Sep 09 2003

Keywords

Comments

For n>0, a(n) = arithmetic mean of the smallest pair of two consecutive primes with a difference 2n.

Examples

			a(5) = 144 as 139 and 149 both are prime and all numbers from 140 to 148 are composite.
		

Formula

a(n) = A000230(n)+n. - David Wasserman, May 24 2005

Extensions

More terms from David Wasserman, May 24 2005
Edited by Franklin T. Adams-Watters, Oct 26 2006

A100964 Smallest prime number that begins a prime gap of at least 2n.

Original entry on oeis.org

3, 7, 23, 89, 113, 113, 113, 523, 523, 887, 1129, 1327, 1327, 1327, 1327, 1327, 1327, 9551, 15683, 15683, 15683, 15683, 19609, 19609, 19609, 19609, 31397, 31397, 31397, 31397, 31397, 31397, 31397, 31397, 31397, 31397, 155921, 155921, 155921, 155921
Offset: 1

Views

Author

T. D. Noe, Nov 23 2004

Keywords

Examples

			a(5) = a(6) = a(7) = 113 because there is a gap of 14 between 113 and 127.
		

Crossrefs

Programs

  • Mathematica
    k=1; Table[While[Prime[k+1]-Prime[k] < 2n, k++ ]; Prime[k], {n, 48}]
  • PARI
    lista(pmax) = {my(k = 1, prv = 2, m = 2, kprv = 2); forprime(p = 3, pmax, k++; if(p - prv >= m, for(i = 1, (p - prv - m)/2 + 1, print1(prv, ", ")); m = p - prv + 2; kprv = k); prv = p);} \\ Amiram Eldar, Sep 06 2024

Formula

a(n) = prime(A144309(n)). - Michel Marcus, Nov 02 2013

A362465 a(n) is the least number of 2 or more consecutive signed primes whose sum equals n.

Original entry on oeis.org

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

Views

Author

Karl-Heinz Hofmann, Apr 21 2023

Keywords

Comments

Inspired by a conjecture made by Carlos Rivera in 2000 (see link). Here we remove Rivera's restriction that the primes have to be smaller than n.
For every positive even n, a(n) = 2, provided there are 2 consecutive primes separated by a gap of size n. Polignac's conjecture says: "For any positive even number n, there are infinitely many prime gaps of size n." If so, a(3) is the only 4 in this sequence, as any even number of consecutive odd signed primes has an even sum.
There is also the reversed sequence for negative n with 0 as the symmetry point.
See A362466 for the first occurrences of numbers in this sequence.

Examples

			a(1) = 2: -2 + 3 = 1.
a(0) = 3: -2 - 3 + 5 = 0.
a(3) = 4:  2 + 3 + 5 - 7 = 3.
The example below for a(29) gives more detail of the general method employed.
a(29) = 5:  3 - 5 + 7 + 11 + 13 = 29.
Since any even number of consecutive odd signed primes has an even sum, we can show a(29) <> 4.
A test with all triples of consecutive signed primes up to 10^9 gave no solution for 29. The estimated lower bound for the permutation p1 + p2 - p3 is p1 - (p1 + 2)^0.525 and was never surpassed. (See Wikipedia link. "A result, due to Baker, Harman and Pintz in 2001, shows that Theta may be taken to be 0.525".) So the terms are calculated with the assumption that this is true.
		

Crossrefs

Cf. A000230, A001632, A362466 (first occurrences).

Programs

  • Python
    from sympy import primepi, sieve as prime
    import numpy
    upto = 50000                   # 5000000 good for 8 GB RAM (3 Minutes)
    primepi_of_upto, np, arr = primepi(upto), 1, []
    A362465 = numpy.zeros(upto + 1, dtype="i4")
    A362465[2:][::2] = 2           # holds if "upto" < 7 * 10^7
    for n in range(1,primepi_of_upto + 1): arr.append([prime[n]])
    while all(A362465) == 0:
        np += 1
        for k in range(0,primepi_of_upto):
            temp = []
            for i in arr[k]:
                temp.append(i + prime[k+np])
                temp.append(abs(i - prime[k+np]))
            arr[k] = set(temp)
            for n in temp:
                if n <= upto and A362465[n] == 0: A362465[n] = np
    print(list(A362465[0:100]))

Formula

a(n) = a(-n).

Extensions

Edited by Peter Munn, Aug 08 2023

A086153 Special prime numbers arranged in a triangle: n-th row contains m primes p (where m = pi(2n + A020483(n)) - pi(A020483(n))) with following properties.

Original entry on oeis.org

3, 7, 3, 23, 5, 89, 23, 3, 139, 19, 7, 3, 199, 47, 17, 5, 113, 83, 23, 17, 3, 1831, 211, 43, 13, 7, 3, 523, 109, 79, 19, 11, 5, 887, 317, 107, 47, 17, 11, 3, 1129, 619, 109, 79, 19, 7, 1669, 199, 113, 73, 43, 13, 5, 2477, 1373, 197, 113, 71, 41, 11, 3, 2971, 1123, 199, 109
Offset: 1

Views

Author

Labos Elemer, Aug 08 2003

Keywords

Comments

1: q = p + 2n is also a prime, although not necessarily the next after p;
2: the k-th position of the n-th row gives is a prime p such that the number of further primes between p and q = p + 2n (not counting p and q) is k-1;
3: the primes p are the smallest with these properties.
Thus each row only contains primes. The first term in the n-th row is A000230(n). The last one in the same row is A020483(n). The length of the n-th row is pi(2n + A020483(n)) - pi(A020483(n)).
From Martin Raab, Aug 29 2021: (Start)
T(n,k) is zero if there is no admissible pattern with k+1 primes for the interval of length 2n under the given properties.
T(38,16) > 2^48. It requires a pattern of 17 primes with a difference of 76 between the first and the last prime. Admissible patterns of this kind exist, but solutions with 17 primes are rather hard to find. (End)
The next unknown values are T(43,19) and T(44,19), which require intervals of 20 primes with a diameter of 86 and 88, respectively. - Brian Kehrig, Jun 25 2024

Examples

			The table begins as follows:
    3;
    7,  3;
   23,  5;
   89, 23,  3;
  139, 19,  7,  3;
  199, 47, 17,  5;
  113, 83, 23, 17,  3;
  ...
For example, suppose n = 50: d = 2n = 100; the 50th row consists of 25 terms as follows: {396733, 58789, 142993, 38461, 37699, 7351, 5881, 1327, 2557, 1879, 1621, 1117, 463, 457, 283, 331, 211, 127, 73, 67, 31, ?, ?, 7, 3};
A000230(50)=396733, A020483(50)=3; between 143093 and 142993 two primes {143053,143063} occur because 142993 is the 3rd (from 2+1) entry in the 50th row.
The length of 50th row is pi(100+3) - pi(3) = pi(103) - pi(3) = 27 - 2 = 25, number of primes between 103 and 3 is 24 (not counting 103 and 3).
		

Crossrefs

Programs

  • Mathematica
    (* Program to generate the 19th row *) cp[x_, y_] := Count[Table[PrimeQ[i], {i, x, y}], True] {d=38, k=0, mxc=Ceiling[d/3]; vg=PrimePi[30593]} t=Table[0, {mxc}]; t1=Table[0, {mxc}]; Do[s=cp[1+Prime[n], Prime[n]+d-1]; np=d+Prime[n]; If[PrimeQ[np]&&s<(1+mxc)&&t[[s+1]]==0, t[[s+1]]=n; t1[[s+1]]=Prime[n]], {n, 1, 5000}]; {t, t1}
  • PARI
    {z=concat(vector(13),binary(8683781)); for(n=1, 37, p1=3; while(!isprime(p1+2*n), p1=nextprime(p1+2)); p2=p1+2*n; k=primepi(p2)-primepi(p1); r=vector(k); r[k]=p1; i1=1; i2=0; s=vecsort(r); while(s[1+z[n]]==0, while(i1*i2==0, p1+=2; p2+=2; i2=isprime(p2); k=k-i1+i2; i1=isprime(p1)); if(!r[k], r[k]=p1; s=vecsort(r)); i2=0); print("row "n": "r))} \\ Martin Raab, Oct 21 2021

A086978 Increasing peaks in the prime gap sequence A001632.

Original entry on oeis.org

211, 1847, 5623, 30631, 81509, 82129, 162209, 173429, 404671, 542683, 544367, 1101071, 1444411, 2238931, 5845309, 6752747, 6958801, 11981587, 13626407, 49269739, 83751287, 147684323, 166726561, 378044179, 895858267, 1872852203
Offset: 1

Views

Author

Harry J. Smith, Jul 26 2003

Keywords

Comments

a(n) is the larger of the two consecutive primes having a late occurring prime gap g = p_k+1 - p_k. All even gaps smaller than g occur at a smaller prime. Also, the next even gap g+2 also occurs earlier.

Examples

			1847 is in this list because the previous prime is 1831, giving a prime gap of 16. All even gaps less than 16 occur before this (for smaller primes) and the next even gap, 18, also occurs earlier.
		

References

  • P. Ribenboim, The Little Book of Big Primes. Springer-Verlag, 1991, p. 144.

Crossrefs

A087770 "Lonely primes": those primes that are locally maximally isolated from the nearest other primes. The differences between each lonely prime and the immediately preceding prime and following primes are both greater than the corresponding differences for all lonely primes earlier in the sequence.

Original entry on oeis.org

2, 3, 7, 23, 89, 211, 1847, 2179, 14107, 33247, 38501, 58831, 268343, 1272749, 2198981, 10938023, 72546283, 162821917, 325737821, 2888688863, 6613941601, 11179888193, 24016237123, 96155166493, 179474021633, 215686840471, 633880576177, 1480975873513, 9156364643509
Offset: 1

Views

Author

Walter Carlini, Oct 03 2003

Keywords

Comments

The concept of "lonely prime" is similar to that of maximal prime gaps since lonely primes are increasingly distant from each other.
See A023186 for another version of this sequence, which only requires increasing the minimum of the two gaps to the neighbors. The definition from A023186 seems to be the more common variant. - Hugo Pfoertner, Dec 17 2019

Examples

			a(0) = 2.
a(1) = 3 because 3 - 2 = 1 and 5 - 3 = 2.
a(2) = 7 because 7 - 5 = 2 (and 2 > 3 - 2) and 11 - 7 = 4 (and 4 > 5 - 3).
a(3) = 23 because 23 - 19 = 4 ( 23 - 19 > 7 - 5) and 29 - 23 = 6 (29 - 23 > 11 - 7).
a(4) = 89 because 89 - 83 = 6 > 23 - 19 and 97 - 89 = 8 > 29 - 23.
Note, for example, that 53 is not a lonely prime because 53 - 47 = 6, which is > 23 - 19 however 59 - 53 = 6, which is not > 29 - 23.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 2; q = 2; r = 3; d = e = 0; Do[ While[ q - p <= d || r - q <= e, p = q; q = r; r = NextPrim[r]]; Print[q]; d = Max[q - p, d]; e = Max[r - q, e]; p = q; q = r; r = NextPrim[r], {n, 1, 40}] (* Robert G. Wilson v *)

Extensions

Corrected and extended by Ray Chandler, Oct 06 2003
Offset changed and a(21)-a(27) from Hugo Pfoertner, Dec 17 2019
a(28)-a(29) from Giovanni Resta, Dec 17 2019

A144309 a(n) is the index of the smallest prime such that the gap to the next prime is not less than 2*n.

Original entry on oeis.org

2, 4, 9, 24, 30, 30, 30, 99, 99, 154, 189, 217, 217, 217, 217, 217, 217, 1183, 1831, 1831, 1831, 1831, 2225, 2225, 2225, 2225, 3385, 3385, 3385, 3385, 3385, 3385, 3385, 3385, 3385, 3385, 14357, 14357, 14357, 14357, 14357, 14357, 14357, 30802, 30802, 30802
Offset: 1

Views

Author

Artur Jasinski, Sep 17 2008

Keywords

Crossrefs

For indices of smallest prime such that gap to next prime is exactly equal to 2*n see A000230. For records in this sequence see A005669.

Programs

  • Mathematica
    a = {}; Do[n = 1; While[(Prime[n + 1] - Prime[n]) < 2 k, n++ ]; AppendTo[a, n], {k, 1, 75}]; a
  • PARI
    lista(pmax) = {my(k = 1, prv = 2, m = 2, kprv = 2); forprime(p = 3, pmax, k++; if(p - prv >= m, for(i = 1, (p - prv - m)/2 + 1, print1(k-1, ", ")); m = p - prv + 2; kprv = k); prv = p);} \\ Amiram Eldar, Sep 06 2024

Formula

a(n) = primepi(A100964(n)) = A000720(A100964(n)). - Michel Marcus, Nov 02 2013

A335366 Primes preceding the first-occurrence gaps in A014320.

Original entry on oeis.org

2, 3, 7, 23, 89, 113, 139, 199, 523, 887, 1129, 1327, 1669, 1831, 2477, 2971, 4297, 5591, 9551, 15683, 16141, 19333, 19609, 28229, 30593, 31397, 31907, 34061, 35617, 43331, 44293, 81463, 82073, 89689, 134513, 155921, 162143, 173359, 188029, 212701, 265621
Offset: 1

Views

Author

Alexei Kourbatov, Jun 03 2020

Keywords

Comments

Contains A002386 as a subsequence. First differs from A002386 at a(7)=139. This sequence is a permutation of all positive terms of A000230, in increasing order. See A002386 and A005250 for more references and links.

Examples

			The first two primes are 2 and 3, and the first prime gap is 3 - 2 = 1; so a(1)=2. The next prime is 5, and the next gap is 5 - 3 = 2; this gap size has not occurred before, so a(2)=3. The next prime is 7, and the next gap is 7 - 5 = 2; the gap size 2 has already occurred before, so nothing is added to the sequence.
		

Crossrefs

Programs

  • PARI
    my(isFirstOcc=vector(9999, j, 1), s=2); forprime(p=3, 1e8, my(g=p-s); if(isFirstOcc[g], print1(s, ", "); isFirstOcc[g]=0); s=p)

Formula

a(n) = A335367(n) - A014320(n).

A337767 Array T(n,k) (n >= 1, k >= 1) read by upward antidiagonals and defined as follows. Let N(p,i) denote the result of applying "nextprime" i times to p; T(n,k) = smallest prime p such that N(p,n) - p = 2*k, or 0 if no such prime exists.

Original entry on oeis.org

3, 0, 7, 0, 3, 23, 0, 0, 5, 89, 0, 0, 0, 23, 139, 0, 0, 0, 3, 19, 199, 0, 0, 0, 0, 7, 47, 113, 0, 0, 0, 0, 3, 17, 83, 1831, 0, 0, 0, 0, 0, 5, 23, 211, 523, 0, 0, 0, 0, 0, 0, 17, 43, 109, 887, 0, 0, 0, 0, 0, 0, 3, 13, 79, 317, 1129, 0, 0, 0, 0, 0, 0, 0, 7, 19, 107, 619, 1669
Offset: 1

Views

Author

Robert G. Wilson v, Sep 19 2020

Keywords

Comments

The positive entries in each row and column are distinct.
Number of zeros right of 3 are 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 1, 3, 3, 3, 6, 5, 5, 4, 6, ..., .
Number of zeros in the n-th row are 0, 1, 3, 4, 6, 7, 10, 13, 14, 17, 18, 20, 22, 25, 28, 30, 32, 36, 37, 40, 45, 47, 51, 52, 55, ..., .
The usual convention in the OEIS is to use -1 in the "escape clause" - that is, when "no such terms exists". It is probably too late to change this sequence, but it should not be cited as a role model for other sequences. - N. J. A. Sloane, Jan 19 2021
a(1416), a(1637), and a(1753) were provided by Brian Kehrig. - Martin Raab, Jun 28 2024

Examples

			The initial rows of the array are:
  3, 7, 23, 89, 139, 199, 113, 1831, 523, 887, 1129, 1669, 2477, 2971, 4297, ...
  0, 3, 5, 23, 19, 47, 83, 211, 109, 317, 619,  199, 1373, 1123, 1627, 4751, ...
  0, 0, 0,  3,  7, 17, 23,  43,  79, 107, 109,  113,  197,  199,  317,  509, ...
  0, 0, 0,  0,  3,  5, 17,  13,  19,  47,  79,   73,  113,  109,  193,  317, ...
  0, 0, 0,  0,  0,  0,  3,   7,  11,  17,  19,   43,   71,   73,  107,  191, ...
  0, 0, 0,  0,  0,  0,  0,   3,   5,  11,   7,   13,   41,   31,   67,  107, ...
  0, 0, 0,  0,  0,  0,  0,   0,   0,   3,   0,    5,   11,   13,   23,   47, ...
  0, 0, 0,  0,  0,  0,  0,   0,   0,   0,   0,    0,    3,    0,    7,   29, ...
  0, 0, 0,  0,  0,  0,  0,   0,   0,   0,   0,    0,    0,    3,    0,    5, ...
The initial antidiagonals are:
  [3]
  [0, 7]
  [0, 3, 23]
  [0, 0, 5, 89]
  [0, 0, 0, 23, 139]
  [0, 0, 0, 3, 19, 199]
  [0, 0, 0, 0, 7, 47, 113]
  [0, 0, 0, 0, 3, 17, 83, 1831]
  [0, 0, 0, 0, 0, 5, 23, 211, 523]
  [0, 0, 0, 0, 0, 0, 17, 43, 109, 887]
  [0, 0, 0, 0, 0, 0, 3, 13, 79, 317, 1129]
  ...
		

Crossrefs

Cf. A000230, A144103, A339943, A339944 (rows 1 to 4), A086153.

Programs

  • Mathematica
    t[r_, c_] := If[ 2c <= Prime[r + 2] - 5, 0, Block[{p = 3}, While[ NextPrime[p, r] != 2c + p && p < 52000000, p = NextPrime@ p]; If[p > 52000000, 0, p]]]; Table[ t[r -c +1, c], {r, 11}, {c, r}] // Flatten

Formula

T(n,k) = 0 if prime(n+2)-5 <= 2k. A089038.
T(n,k) = 3 if prime(n+2) = 2k+6. A067076.

Extensions

Entry revised by N. J. A. Sloane, Nov 07 2020
Deleted a-file and b-file because entries were unreliable. - N. J. A. Sloane, Nov 01 2021
Previous Showing 41-50 of 108 results. Next