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.

Showing 1-4 of 4 results.

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

A339943 Let N(p,i) denote the result of applying "nextprime" i times to p; a(n) = smallest prime p such that N(p,3) - p = 2*n, or -1 if no such prime exists.

Original entry on oeis.org

-1, -1, -1, 3, 7, 17, 23, 43, 79, 107, 109, 113, 197, 199, 317, 509, 523, 773, 1823, 1237, 1319, 3119, 1321, 2473, 2153, 4159, 2477, 6491, 5581, 7351, 9551, 9973, 18803, 18593, 24247, 30559, 31883, 33211, 19603, 66191, 37699, 31393, 83117, 43801, 107351, 107357, 69499, 38461, 130859
Offset: 1

Views

Author

Robert G. Wilson v, Dec 23 2020

Keywords

Comments

This sequence is the third row of A337767.a(n) > 0 and that there are multiple instances for some k where (p_(k+3) - p_k)/2 - 3 = n.
This sequence only cites the first such occurrence.
n:
4: 3, 5, 11, 101, 191, 821, 1481, 1871, 2081, 3251, 3461, 5651, ...,
5: 7, 13, 37, 97, 103, 223, 307, 457, 853, 877, 1087, 1297, ...,
6: 17, 19, 29, 31, 41, 59, 61, 67, 71, 127, 227, 229, ...,
7: 23, 47, 53, 89, 137, 149, 167, 179, 257, 263, 419, 449, ...,
8: 43, 73, 151, 157, 163, 181, 277, 337, 367, 373, 433, 487, ...,
9: 79, 83, 131, 139, 173, 193, 211, 233, 239, 251, 331, 349, ...,
10: 107, 293, 311, 353, 359, 389, 401, 479, 503, 653, 719, 839, ...,
etc.

Examples

			a(4) = 3. This represents the beginning of the run of primes {3, 5, 7, 11}. (11 - 3)/2 = 4 and it is the first prime to do so. Others are 5, 11, 101, 191, etc.;
a(5) = 7. This represents the beginning of the run of primes {7, 11, 13, 17}. (17 - 7)/2 = 5 and it is the first prime to do so. Others are 13, 37, 97, 103, etc.;
a(6) = 17. This represents the beginning of the run of primes {17, 19, 23 & 29}. (29 - 17)/2 = 6 and it is the first prime to do so. Others are 19, 29, 31, 41, etc.
		

Crossrefs

Programs

  • Mathematica
    p = 3; q = 5; r = 7; s = 11; tt[_] := 0; While[p < 250000, d = (s - p)/2; If[ tt[d] == 0, tt[d] = p]; {p, q, r, s} = {q, r, s, NextPrime@ s}]; tt@# & /@ Range@ 75

A339944 Let N(p,i) denote the result of applying "nextprime" i times to p; a(n) = smallest prime p such that N(p,4) - p = 2*n, or -1 if no such prime exists.

Original entry on oeis.org

-1, -1, -1, -1, 3, 5, 17, 13, 19, 47, 79, 73, 113, 109, 193, 317, 313, 521, 503, 523, 887, 1499, 1231, 1319, 1373, 1321, 1307, 3947, 2473, 2143, 2477, 7369, 5573, 5939, 9967, 16111, 18587, 20773, 18593, 31883, 17209, 19597, 24251, 19609, 25471, 31397, 44389, 18803, 38459, 38461, 66191, 69557, 103183
Offset: 1

Views

Author

Robert G. Wilson v, Dec 23 2020

Keywords

Comments

This sequence is the fourth row of A337767.
From Robert G. Wilson v, Dec 30 2020: (Start)
a(n) > -1 for all n >= 5.
It seems likely that for almost all values of n there is more than one integer k such that prime(k+4) - prime(k) = 2*n; a(n) = prime(k) for the smallest such k.
.
n | list of numbers k such that prime(k+4) - prime(k) = 2*n
---+-----------------------------------------------------------------
5 | 3.
6 | 5, 7, 11, 97, 101, 1481, 1867, 3457, 5647, 15727, 16057, ...
7 | 17, 29, 59, 227, 269, 1277, 1289, 1607, 2129, 2789, 3527, ...
8 | 13, 31, 37, 67, 223, 1087, 1291, 1423, 1483, 1597, 1861, ...
9 | 19, 23, 41, 43, 53, 61, 71, 89, 149, 163, 179, ...
10 | 47, 83, 131, 137, 173, 191, 251, 257, 347, 419, 443, ...
etc.
(End)

Examples

			a(1) = 3. This represents the beginning of the run of primes {3, 5, 7, 11, 13}. (13 - 3)/2 = 5 and it is the only prime to do so.
a(2) = 5. This represents the beginning of the run of primes {5, 7, 11, 13, 17}. (17 - 5)/2 = 6 and it is the first prime to do so. Others are 7, 11, 97, 101, etc.
a(3) = 17. This represents the beginning of the run of primes {17, 19, 23, 29, 31}. (31 - 17)/2 = 7 and it is the first prime to do so. Others are 29, 59, 227, 269, etc.
		

Crossrefs

Programs

A359199 Least prime p such that 2n can be written as a signed sum of p and the next 3 primes, or -1 if no such prime exists.

Original entry on oeis.org

5, 3, 3, 3, 7, 3, 3, 5, 3, 19, 3, 5, 79, 3, 113, 17, 467, 7, 5, 11, 19, 17, 19, 13, 7, 17, 1123, 17, 19, 23, 11, 23, 19, 31, 2153, 31, 13, 23, 29, 31, 29, 37, 43, 37, 17, 31, 19081, 37, 43, 41, 19319, 19, 37897, 53, 43, 54193, 35671, 47, 43, 53, 23, 53, 59, 47, 35603, 61
Offset: 0

Views

Author

Karl-Heinz Hofmann and Peter Munn, Jun 04 2023

Keywords

Comments

We require each of the 4 primes to appear in the sum exactly once.
Inspired by the study of problems about the signed sum of consecutive primes, for example, by Rivera in 2000 (see link).
The equivalent sequence with 2 rather than 4 primes is A363544, which is closely related to A000230, which concerns prime gaps.
Conjecture: a satisfactory prime p exists for all n.
The magnitude of the terms exhibits a notable variation that depends on the number of negations in the sum. See the visualization in the links.
All odd primes appear in the sequence. When 2n = A034963(k) we see the last occurrence of the k-th prime. Obviously, these last occurrences correspond to the sums where all the signs are positive. Do any odd primes occur only once?

Examples

			The signed sums of 2, 3, 5 and 7 are all odd, so cannot be 2n for any n. So all terms are >= 3, the 2nd prime.
The 16 possible signed sums of 3, 5, 7 and 11 give 8 nonnegative totals: 2, 4, 6, 10, 12, 16, 20, 26. So a(1) = a(2) = a(3) = a(5) = a(6) = a(8) = a(10) = a(13) = 3.
0 was not one of the 8 totals, and 0 = 5 - 7 - 11 + 13. So a(0) = 5.
		

Crossrefs

Programs

  • Python
    from sympy import nextprime
    import numpy as np
    aupto = 100
    A359199 = np.zeros(aupto+1, dtype=object)
    signset = np.array([[ 1,  1,  1,  1] , # green line in visualizations (see links)
                        [ 1,  1,  1, -1] , # red ribbon
                        [ 1,  1, -1,  1] , # red ribbon
                        [ 1, -1,  1,  1] , # red ribbon
                        [ 1,  1, -1, -1] , # magenta ribbon
                        [ 1, -1,  1, -1] , # magenta ribbon
                        [ 1, -1, -1,  1] , # magenta ribbon
                        [ 1, -1, -1, -1]], # red ribbon
                        dtype="i4")
    primeset = np.array([3, 5, 7, 11], dtype=object)
    while all(A359199) == 0:
        for signs in signset:
            asum = abs(sum(signs * primeset)) // 2
            if asum <= aupto and A359199[asum] == 0: A359199[asum] = primeset[0]
        primeset = np.append(primeset, nextprime(primeset[-1]))[1:]
    print(list(A359199))

Formula

For k >= 2, a(A034963(k)/2) = A000040(k).
Showing 1-4 of 4 results.