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.

User: Fabio Mercurio

Fabio Mercurio's wiki page.

Fabio Mercurio has authored 3 sequences.

A330026 a(n) is the number of integers k > prime(n) such that all rows (after the initial row) of the triangle of absolute differences of the (n+1)-tuple (prime(1), ..., prime(n), k) all start with 1.

Original entry on oeis.org

1, 1, 2, 2, 5, 4, 5, 4, 5, 6, 10, 9, 8, 5, 8, 7, 15, 12, 14, 17, 12, 15, 11, 16, 16, 18, 13, 14, 14, 21, 45, 29, 34, 26, 32, 25, 25, 25, 22, 20, 26, 20, 32, 24, 33, 23, 38, 48, 36, 34, 40, 30, 31, 30, 37, 31, 33, 39, 37, 38, 32, 48, 41, 44, 36, 52, 54, 43, 43, 51
Offset: 1

Author

Fabio Mercurio, Nov 27 2019

Keywords

Comments

Suggested by Gilbreath's conjecture (see A036262).
The sequence of primes considered in Gilbreath's conjecture is just one possibility out of all the sequences that can be generated starting from (2,3,...,prime(n)).
Conjecture: Prime(n+1) is always between prime(n)+2 and prime(n)+2*a(n).

Examples

			a(1) = 1, because considering the sequence (2,k), k=3 is the only solution.
a(2) = 1, because considering the sequence (2,3,k), k=5 is the only solution.
To calculate a(3), consider the sequence (2,3,5) and calculate the triangle of absolute differences:
2,3,5
1,2
1
Consider the rightmost diagonal, which contains the absolute differences (2,1), then a(3) is given by a(3) = [(2+1) + 1]/2 = 2.
That is, a(3) is the result of summing the two differences contained in the rightmost diagonal (2,1). To this sum we add 1 and divide the total by 2.
So there are 2 integers k > prime(3) = 5 -- namely, 7,9 -- such that the forward absolute differences of (2,3,5,k) start with 1.
To be explicit, there are two triangles of absolute differences resulting from (2,3,5,k), namely
2 3 5 7
1 2 2
1 0
1
and
2 3 5 9
1 2 4
1 2
1
a(24) = 16 because there are 16 integers k > prime(25) = 97 -- namely, 99,101,...,129 -- such that all rows (after the first row) of the triangle of absolute differences of (2,3,5,7,11,13,17,...,97,k) start with 1.
		

Crossrefs

Programs

  • PARI
    diffs(v) = {while (#v != 1, v = vector(#v-1, k, abs(v[k+1] - v[k]));); v[1];}
    a(n) = {my(v = primes(n), m = vecmax(v)+1, nb = 0); if (!(m%2), m++); forstep (k=m, oo, 2, if (diffs(concat(v, k)) == 1, nb++, if (nb, break));); nb;} \\ Michel Marcus, Dec 03 2019
  • Python
    # run the function find_M(n), where n is the last prime number of your list of consecutive primes starting from 2
    from sympy import isprime
    def primes_less_N(n):
        primes = []
        for i in range(2,n+1):
            if(isprime(i)==True):
                primes.append(i)
        return primes
    def find_M(n):
        primes = primes_less_N(n)
        l = len(primes)
        count = 1
        if count == 1:
            a = [abs(x - primes[i - 1]) for i, x in enumerate(primes)][1:]
            count += 1
        list_f = []
        if count > 1:
            while count 
    				

Formula

Given the sequence of primes S = (2,3,5,...,prime(n)) and the triangle of the forward absolute differences of S, let d(r) be the last rightmost absolute difference of row r, for r>1. Then a(n) = (1+ Sum_{r>1} d(r)) / 2.

A187754 Number of ways of writing the n-th twin prime p as p = q + r + s, where q >= r >= s are twin primes.

Original entry on oeis.org

0, 0, 0, 1, 2, 3, 3, 6, 5, 8, 7, 7, 8, 8, 9, 10, 12, 14, 13, 15, 14, 21, 20, 20, 22, 22, 23, 23, 24, 36, 34, 36, 38, 42, 44, 43, 44, 51, 53, 59, 56, 48, 53, 57, 58, 57, 60, 75, 78, 87, 87, 78, 79, 67, 65
Offset: 1

Author

Fabio Mercurio, Jan 03 2013

Keywords

Comments

The author conjectures that a(n) >= 1 for all n >= 4.
By Zhi-Wei Sun's conjecture related to A219157, for any positive integer n not among 1, 10, 430 we can write 6n-1 = p+2q = p+q+q with p,p-2,q,q+2 all prime, also for any integer n>702 we can write 6n+1 = 6(n-1)+7 = p+q+7 with p,p-2,q,q+2 all prime. Thus the author's conjecture is a consequence of Sun's conjecture. - Zhi-Wei Sun, Jan 06 2013

Examples

			a(9) = 5 because the ninth twin prime, A001097(9), is 31, and 31 can be written as a sum of three twin primes in 5 distinct ways: 3+11+17, 5+7+19, 5+13+13, 7+7+17, and 7+11+13.
		

Crossrefs

Cf. A001097.

Programs

  • PARI
    isA001097(n) = (isprime(n) & (isprime(n+2) || isprime(n-2)))
    A187754(n) = {local(q, r, s, a); a=0; for( q=1, n, if( isA001097(q), for( r=1, q, if( isA001097(r), for( s=1, r, if( isA001097(s) && (n==q+r+s), a=a+1)))))); a}
    n=1; for( p=1, 700, if( isA001097(p), print(n, " ", A187754(p)); n=n+1)) /* Michael B. Porter, Jan 05 2013 */

A187828 Partition the sequence of consecutive primes into groups so that the absolute value of the alternating sum (-1)^n (An) with n = 0,....m in each group is prime.

Original entry on oeis.org

3, 19, 37, 53, 71, 109, 149, 211, 251, 277, 307, 359, 397, 449, 479, 521, 593, 641, 709, 769, 823, 859, 919, 1009, 1033, 1087, 1171, 1217, 1277, 1321, 1367, 1399, 1459, 1549, 1609, 1637, 1693, 1747, 1879, 1973, 2039, 2099, 2213, 2341, 2399, 2437, 2531, 2663, 2777, 2879, 2939, 3061, 3251, 3433
Offset: 1

Author

Fabio Mercurio, Dec 27 2012

Keywords

Comments

From Robert Israel, Jun 24 2020: (Start)
The alternating sum must consist of more than two terms, and a(n) is the absolute value of that alternating sum.
Is the sequence increasing? For k <= 99999, a(k+1) >= a(k)+14. (End)

Examples

			a(1)=3 because the absolute value of the alternating sum (-1)^n (An) where An = (2, 3, 5, 7) with n = (0,1,2,3), is prime; a(2)=19 because the absolute value of the alternating sum (-1)^n (An) where An = (11, 13, 17, 19, 23) with n = (0, 1, 2, 3), is prime; a(3)=37 because the absolute value of the alternating sum (-1)^n (An) where An = (29, 31, 37, 41, 43) with n = (0, 1, 2, 3, 4) is prime.
		

Programs

  • Maple
    p:= 1: R:= NULL:
    for count from 1 to 50 do
      q:= nextprime(p); p:= nextprime(q); t:= q-p;
      e:= 1;
      do p:= nextprime(p);
         t:= t + e*p;
         e:= -e;
      until isprime(abs(t));
      R:= R, abs(t);
    od:
    R; # Robert Israel, Jun 23 2020

Formula

a(x) = Sum_{(-1)^n (An) with n = (0, 1, 2..m)}.

Extensions

More terms from Robert Israel, Jun 24 2020