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

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
Showing 1-1 of 1 results.