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.

A045917 From Goldbach problem: number of decompositions of 2n into unordered sums of two primes.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 2, 4, 4, 2, 3, 4, 3, 4, 5, 4, 3, 5, 3, 4, 6, 3, 5, 6, 2, 5, 6, 5, 5, 7, 4, 5, 8, 5, 4, 9, 4, 5, 7, 3, 6, 8, 5, 6, 8, 6, 7, 10, 6, 6, 12, 4, 5, 10, 3, 7, 9, 6, 5, 8, 7, 8, 11, 6, 5, 12, 4, 8, 11, 5, 8, 10, 5, 6, 13, 9, 6, 11, 7, 7, 14, 6, 8, 13, 5, 8, 11, 7, 9
Offset: 1

Views

Author

Keywords

Comments

Note that A002375 (which differs only at the n = 2 term) is the main entry for this sequence.
The graph of this sequence is called Goldbach's comet. - David W. Wilson, Mar 19 2012
This is the row length sequence of A182138, A184995 and A198292. - Jason Kimberley, Oct 03 2012
The Goldbach conjecture states that a(n) > 0 for n >= 2. - Wolfdieter Lang, May 14 2016
With the second Maple program, the command G(2n) yields all the unordered pairs of prime numbers having sum 2n; caveat: a pair {a,a} is listed as {a}. Example: G(26) yields {{13}, {3,23}, {7,19}}. The command G(100000) yields 810 pairs very fast. - Emeric Deutsch, Jan 03 2017
Conjecture: Let p denote any prime in any decomposition of 2n. 4 and 6 are the only numbers n such that 2n + p is prime for every p. - Ivan N. Ianakiev, Apr 06 2017
Conjecture: For all m >= 0, there exists at least one possible value of n such that a(n) = m. - Ahmad J. Masad, Jan 06 2018
The previous conjecture is related to the sequence A053033. - Ahmad J. Masad, Dec 09 2019
Conjecture: For each k >= 0, there exists a minimum sufficiently large number r that depends on k such that for each n >= r, a(n) > k. - Ahmad J. Masad, Jan 08 2020
Conjecture: If the previous conjecture is true, then for each m >= 0, the number of terms that are equal to (m+1) is larger than the number of terms that are equal to m. - Ahmad J. Masad, Jan 08 2020
Also, the number of equidistant prime pairs in Goldbach's Prime Triangle for integers n > 2. An equidistant prime pair is a pair of not necessarily different prime numbers (p1, p2) that have the same distance d >= 0 from an integer n, i.e., so that p1 = n - d and p2 = n + d. - Jörg Winkelmann, Mar 05 2025

References

  • Calvin C. Clawson, "Mathematical Mysteries, the beauty and magic of numbers," Perseus Books, Cambridge, MA, 1996, Chapter 12, pages 236-257.
  • H. Halberstam and H. E. Richert, 1974, "Sieve methods", Academic press, London, New York, San Francisco.

Crossrefs

Cf. A002375 (the main entry for this sequence (which differs only at the n=2 term)).
Cf. A023036 (first appearance of n), A000954 (last (assumed) appearance of n).

Programs

  • Haskell
    a045917 n = sum $ map (a010051 . (2 * n -)) $ takeWhile (<= n) a000040_list
    -- Reinhard Zumkeller, Sep 02 2013
    
  • Magma
    [#RestrictedPartitions(2*n,2,Set(PrimesInInterval(1,2*n))):n in [1..100]]; // Marius A. Burtea, Jan 23 2020
  • Maple
    A045917 := proc(n)
        local a,i ;
        a := 0 ;
        for i from 1 to n do
            if isprime(i) and isprime(2*n-i) then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Jul 01 2013
    # second Maple program:
    G := proc (n) local g, j: g := {}: for j from 2 to (1/2)*n do if isprime(j) and isprime(n-j) then g := `union`(g, {{n-j, j}}) end if end do: g end proc: seq(nops(G(2*n)), n = 1 .. 98); # Emeric Deutsch, Jan 03 2017
  • Mathematica
    f[n_] := Length[Select[2n - Prime[Range[PrimePi[n]]], PrimeQ]]; Table[ f[n], {n, 100}] (* Paul Abbott, Jan 11 2005 *)
    nn = 10^2; ps = Boole[PrimeQ[Range[1,2*nn,2]]]; Join[{0,1}, Table[Sum[ps[[i]] ps[[n-i+1]], {i, Ceiling[n/2]}], {n, 3, nn}]] (* T. D. Noe, Apr 13 2011 *)
  • PARI
    a(n)=my(s);forprime(p=2,n,s+=isprime(2*n-p));s \\ Charles R Greathouse IV, Mar 27 2012
    
  • Python
    from sympy import isprime
    def A045917(n):
        x = 0
        for i in range(2,n+1):
            if isprime(i) and isprime(2*n-i):
                x += 1
        return x # Chai Wah Wu, Feb 24 2015
    

Formula

From Halberstam and Richert: a(n) < (8+0(1))*c(n)*n/log(n)^2 where c(n) = Product_{p>2} (1 - 1/(p-1)^2)*Product_{p|n, p>2} (p-1)/(p-2). It is conjectured that the factor 8 can be replaced by 2. - Benoit Cloitre, May 16 2002
a(n) = ceiling(A035026(n) / 2) = (A035026(n) + A010051(n)) / 2.
a(n) = Sum_{i=2..n} floor(2/Omega(i*(2*n-i))). - Wesley Ivan Hurt, Jan 24 2013
a(n) = A224709(n) + (primepi(2n-2) - primepi(n-1)) + primepi(n) + 1 - n. - Anthony Browne, May 03 2016
a(n) = A224708(2n) - A224708(2n+1) + A010051(n). - Anthony Browne, Jun 26 2016
a(n) = Sum_{k=n*(n-1)/2+2..n*(n+1)/2} A064911(A105020(k-1)). - Wesley Ivan Hurt, Sep 11 2021
a(n) = omega(A362641(n)) = omega(A362640(n)). - Wesley Ivan Hurt, Apr 28 2023

A182138 Irregular triangle T, read by rows, in which row n lists the distances between n and the two primes whose sum makes 2n in decreasing order (Goldbach conjecture).

Original entry on oeis.org

0, 0, 1, 2, 0, 1, 4, 0, 5, 3, 4, 2, 7, 3, 8, 6, 0, 7, 5, 1, 10, 6, 0, 9, 3, 8, 4, 2, 13, 3, 14, 12, 6, 0, 13, 11, 5, 1, 12, 0, 17, 9, 3, 16, 10, 8, 2, 19, 15, 9, 20, 18, 6, 0, 19, 17, 13, 7, 5, 22, 18, 12, 6, 21, 15, 3, 20, 16, 14, 10, 4, 25, 15, 9, 24, 18, 12, 0, 23, 17, 13, 11, 7, 1
Offset: 2

Views

Author

Jean COHEN, Apr 16 2012

Keywords

Comments

The Goldbach conjecture is that for any even integer 2n>=4, at least one pair of primes p and q exist such that p+q=2n. The present numbers listed here are the distances d between each prime and n, the half of the even integer 2n: d=n-p=q-n with p <= q.
See the link section for plots I added. - Jason Kimberley, Oct 04 2012
Each nonzero entry d of row n is coprime to n. For otherwise n+d would be composite. - Jason Kimberley, Oct 10 2012

Examples

			n=2, 2n=4, 4=2+2, p=q=2 -> d=0.
n=18, 2n=36, four prime pairs have a sum of 36: 5+31, 7+29, 13+23, 17+19, with the four distances d being 13=18-5=31-18, 11=18-7=29-18, 5=18-13=23-18, 1=18-17=19-18.
Triangle begins:
  0;
  0;
  1;
  2, 0;
  1;
  4, 0;
  5, 3;
  4, 2;
  7, 3;
  8, 6, 0;
		

Crossrefs

Cf. A045917 (row lengths), A047949 (first column), A047160 (last elements of rows).
Cf. A184995.

Programs

Formula

T(n,i) = n - A184995(n,i). - Jason Kimberley, Sep 25 2012

A184995 Irregular triangle T, read by rows, in which row n lists the primes p <= n such that 2n-p is also prime.

Original entry on oeis.org

2, 3, 3, 3, 5, 5, 3, 7, 3, 5, 5, 7, 3, 7, 3, 5, 11, 5, 7, 11, 3, 7, 13, 5, 11, 7, 11, 13, 3, 13, 3, 5, 11, 17, 5, 7, 13, 17, 7, 19, 3, 11, 17, 5, 11, 13, 19, 3, 7, 13, 3, 5, 17, 23, 5, 7, 11, 17, 19, 3, 7, 13, 19, 5, 11, 23, 7, 11, 13, 17, 23, 3, 13, 19, 5, 11, 17, 29, 7, 13, 17, 19, 23, 29
Offset: 2

Views

Author

Jason Kimberley, Sep 03 2011

Keywords

Comments

Row n has first entry A020481(n), length A045917(n), and last entry A112823(n).
Each row is the prefix to the middle of the corresponding row of A171637.
The Goldbach conjecture states that this irregular Goldbach triangle has in each row at least one entry (A045917(n) >= 1). - Wolfdieter Lang, May 14 2016

Examples

			The irregular triangle T(n, i) starts:
n, 2*n\i  1   2   3   4   5   6 ...
2,   4    2
3,   6    3
4,   8    3
5,  10    3   5
6,  12    5
7,  14    3   7
8,  16    3   5
9,  18    5   7
10, 20    3   7
11, 22    3   5  11
12, 24    5   7  11
13, 26    3   7  13
14, 28    5  11
15, 30    7  11  13
16, 32    3  13
17, 34    3   5  11  17
18, 36    5   7  13  17
19, 38    7  19
20, 40    3  11  17
21, 42    5  11  13  19
22, 44    3   7  13
23, 46    3   5  17  23
24, 48    5   7  11  17  19
25, 50    3   7  13  19
26, 52    5  11  23
27, 54    7  11  13  17  23
28, 56    3  13  19
29, 58    5  11  17  29
30, 60    7  13  17  19  23  29
... reformatted - _Wolfdieter Lang_, May 14 2016
		

Crossrefs

Programs

  • Magma
    A184995 := func;
    &cat[A184995(n):n in [2..30]];
  • Maple
    T:= n-> seq(`if`(andmap(isprime, [p, 2*n-p]), p, NULL), p=2..n):
    seq(T(n), n=2..40);  # Alois P. Heinz, Jan 09 2025
  • Mathematica
    Table[Select[Prime@ Range@ PrimePi@ n, PrimeQ[2 n - #] &], {n, 2, 30}] // Flatten (* Michael De Vlieger, May 14 2016 *)
    T[n_] := Table[If[PrimeQ[p] && PrimeQ[2n-p], p, Nothing], {p, 2, n}];
    Table[T[n], {n, 2, 30}] // Flatten (* Jean-François Alcover, Jan 09 2025, after Alois P. Heinz in A182138 *)

Formula

T(n,i) = n - A182138(n,i). - Jason Kimberley, Sep 25 2012
Showing 1-3 of 3 results.