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-3 of 3 results.

A362466 First occurrence of n in A362465 or -1 if n is not a term in A362465.

Original entry on oeis.org

1, 0, 3, 29, -1, 521, -1, 31751, -1, 47973321, -1
Offset: 2

Views

Author

Karl-Heinz Hofmann and Peter Munn, Apr 24 2023

Keywords

Comments

All terms a(n) for even n > 4 are conjectures and conjectured to be -1. This follows from the reason derived from Polignac's conjecture that is described in A362465.
The requirements for the truth of the above conjecture about this sequence seem to be notably weaker than for Polignac's conjecture.

Examples

			a(5) = 29 because it is the least number that cannot be expressed as a sum of more than 1 and fewer than 5 consecutive signed primes. The example in A362465 shows that there is a solution for 29 with 5 consecutive signed primes, but not with more than 1 and fewer than 5.
		

Crossrefs

Cf. A362465.

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).

A363544 Least prime p such that 2n can be written as the sum or absolute difference of p and the next prime, or -1 if no such prime exists.

Original entry on oeis.org

-1, 3, 7, 23, 3, 139, 5, 113, 1831, 7, 887, 1129, 11, 2477, 2971, 13, 5591, 1327, 17, 30593, 19333, 19, 15683, 81463, 28229, 31907, 23, 35617, 82073, 44293, 29, 34061, 89689, 162143, 31, 173359, 31397, 404597, 212701, 37, 542603, 265621, 41, 155921, 544279, 43, 927869, 1100977
Offset: 0

Views

Author

Karl-Heinz Hofmann and Peter Munn, Jun 09 2023

Keywords

Comments

In recent years, a number of problems have been investigated that concern representing integers as the signed sum of consecutive prime numbers. See, for example, A327467 and the Rivera link.
A000230, which concerns prime gaps, can be considered a more historic such sequence. Here we look at a minor generalization of A000230 in the spirit of signed sums.
When a(n) <> -1, a(n) together with the next prime generate a satisfactory example for proving A362465(2n) = 2.

Crossrefs

Programs

  • Python
    from sympy import sieve as prime
    def A363544(n):
        if n == 0: return -1
        k = 2
        while (prime[k] + prime[k+1]) < 2*n and (prime[k] + prime[k+1]) // 2 != n: k += 1
        if (prime[k] + prime[k+1]) // 2 == n: return prime[k]
        k = 2
        while (prime[k+1] - prime[k]) // 2 != n: k += 1
        return prime[k]
    print([A363544(n) for n in range(0,50)])

Formula

If 2n is in A001043 then a(n) = prime(k), where k is the position of 2n in A001043, otherwise for n > 0, a(n) = A000230(n).
a(n) = -1 if and only if A362465(2n) <> 2.
Showing 1-3 of 3 results.