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

A002372 Goldbach conjecture: number of decompositions of 2n into ordered sums of two odd primes.

Original entry on oeis.org

0, 0, 1, 2, 3, 2, 3, 4, 4, 4, 5, 6, 5, 4, 6, 4, 7, 8, 3, 6, 8, 6, 7, 10, 8, 6, 10, 6, 7, 12, 5, 10, 12, 4, 10, 12, 9, 10, 14, 8, 9, 16, 9, 8, 18, 8, 9, 14, 6, 12, 16, 10, 11, 16, 12, 14, 20, 12, 11, 24, 7, 10, 20, 6, 14, 18, 11, 10, 16, 14, 15, 22, 11, 10, 24, 8, 16, 22, 9, 16, 20, 10
Offset: 1

Views

Author

Keywords

Comments

The weak form of this conjecture was proved by Helfgott (see link below). - T. D. Noe, May 14 2013
Goldbach conjectured in 1742 that for n >= 3, this sequence never vanishes. This is still unproved.
Number of different primes occurring when 2n is expressed as p1+q1 = ... = pk+qk where pk,qk are odd primes with pk <= qk. For example when n=5: 10 = 3+7 = 5+5, we can see 3 different primes so a(5) = 3. - Naohiro Nomoto, Feb 24 2002
Comments from Tomás Oliveira e Silva to Number Theory List, Feb 05 2005: With the help of Siegfied "Zig" Herzog of PSU, I was able to verify the Goldbach conjecture up to 2e17. Let 2n=p+q, with p and q prime be a Goldbach partition of 2n. In a minimal Goldbach partition p is as small as possible. The largest p of a minimal Goldbach partition found was 8443 and is needed for 2n=121005022304007026. Furthermore, the largest prime gap found was 1220-1; it occurs after the prime 80873624627234849.
Comments from Tomás Oliveira e Silva to Number Theory List, Apr 26 2007: With the help of Siegfried "Zig" Herzog, the NCSA and others, I have just finished the verification of the Goldbach conjecture up to 1e18. This took about 320 years of CPU time, including a double-check of the results up to 1e17. As expected, no counterexample to the conjecture was found. As side results, the number of twin primes up to 1e18 was also computed, as was the number of primes in each of the residue classes modulo 120. Also, the number of occurrences of each (observed) prime gap was also recorded.
For n > 2 we have a(n) = 2*A002375(n)-1 if n is prime and a(n) = 2*A002375(n) if n is composite. - Emeric Deutsch, Jul 14 2004
For n > 2, a(n) = 2*A002375(n) - A010051(n). - Jason Kimberley, Aug 31 2011
a(n) = Sum_{p odd prime < 2*n} A010051(2*n - p). - Reinhard Zumkeller, Oct 19 2011
There is an interesting similarity with square numbers: The number of divisors of n is odd iff n is square (A000290). The number of decompositions of 2n into ordered sums of two primes (equaling the number of the unique primes in all such decompositions) is odd iff n is prime. - Ivan N. Ianakiev, Feb 28 2015

Examples

			2 has no such decompositions, so a(1) = 0.
Idem for 4, whence a(2) = 0.
6 = 3+3, so a(3) = 1.
8 = 3+5 = 5+3, so a(4) = 2.
10 = 5+5 = 3+7 = 7+3, so a(5) = 3.
12 = 5+7 = 7+5; so a(6) = 2, etc.
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 9.
  • R. K. Guy, Unsolved problems in number theory, second edition, Springer-Verlag, 1994.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Section 2.8 (for Goldbach conjecture).
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, pp. 79, 80.
  • N. Pipping, Neue Tafeln für das Goldbachsche Gesetz nebst Berichtigungen zu den Haussnerschen Tafeln, Finska Vetenskaps-Societeten, Comment. Physico Math. 4 (No. 4, 1927), pp. 1-27.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • M. L. Stein and P. R. Stein, Tables of the Number of Binary Decompositions of All Even Numbers Less Than 200,000 into Prime Numbers and Lucky Numbers. Report LA-3106, Los Alamos Scientific Laboratory of the University of California, Los Alamos, NM, Sep 1964.

Crossrefs

Essentially identical to A035026.

Programs

  • Haskell
    a002372 n = sum $ map (a010051 . (2*n -)) $ takeWhile (< 2*n) a065091_list
    -- Reinhard Zumkeller, Oct 19 2011
    
  • Magma
    A002372 := func; [A002372(n):n in[1..82]]; // Jason Kimberley, Sep 01 2011
    
  • Maple
    a:=proc(n) local c,k; c:=0: for k from 1 to n do if isprime(2*k+1)=true and isprime(2*n-2*k-1)=true then c:=c+1 else c:=c fi od end: seq(a(n),n=1..82); # Emeric Deutsch, Jul 14 2004
  • Mathematica
    For[lst={}; n=1, n<=100, n++, For[cnt=0; i=1, i<=2n-1, i++ If[OddQ[i]&&PrimeQ[i]&&PrimeQ[2n-i], cnt++ ]]; AppendTo[lst, cnt]]; lst
    (* second program: *)
    A002372[n_] := Module[{i = 0}, Do[If[PrimeQ[2 n - Prime@p], i++], {p, 2, PrimePi[2 n - 3]}]; i]; Array[A002372, 82] (* JungHwan Min, Aug 24 2016 *)
    i[n_] := If[PrimeQ[2 n - 1], 2 n - 1, 0]; A085090 = Array[i, 82];
    r[n_] := Table[A085090[[k]] + A085090[[n - k + 1]], {k, 1, n}];
    countzeros[l_List] := Sum[KroneckerDelta[0, k], {k, l}];
    Table[n - 2 countzeros[A085090[[1 ;; n]]] + countzeros[r[n]],
    {n, 1, 82}] (* Fred Daniel Kline, Aug 13 2018 *)
    countPrimes[n_] := Sum[KroneckerDelta[True, PrimeQ[2 m - 1],
    PrimeQ[2 (n - m + 1) - 1]], {m, 1, n}]; Array[countPrimes, 82] (* Fred Daniel Kline, Oct 07 2018 *)
  • PARI
    isop(n) = (n % 2) && isprime(n);
    a(n) = n*=2; sum(i=1, n-1, isop(i)*isop(n-i)); \\ Michel Marcus, Aug 22 2014 and May 28 2020
    
  • Python
    from sympy import isprime, primerange
    def a(n): return sum([1 for p in primerange(3, 2*n-2) if isprime(2*n-p)])
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Apr 23 2017

Formula

a(n) = A010051(n) + 2*A061357(n), n > 2. - R. J. Mathar, Aug 19 2013

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jun 13 2002
Edited by M. F. Hasler, May 03 2019

A001031 Goldbach conjecture: a(n) = number of decompositions of 2n into sum of two primes (counting 1 as a prime).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of decompositions of 2*n into sum of two noncomposite numbers. - Omar E. Pol, Dec 12 2024

Examples

			1 is counted as a prime, so a(1)=1 since 2=1+1, a(2)=2 since 4=2+2=3+1, ..
		

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 9.
  • Deshouillers, J.-M.; te Riele, H. J. J.; and Saouter, Y.; New experimental results concerning the Goldbach conjecture. Algorithmic number theory (Portland, OR, 1998), 204-215, Lecture Notes in Comput. Sci., 1423, Springer, Berlin, 1998.
  • Apostolos Doxiadis: Uncle Petros and Goldbach's Conjecture, Faber and Faber, 2001
  • R. K. Guy, Unsolved problems in number theory, second edition, Springer-Verlag, 1994.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 79.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • M. L. Stein and P. R. Stein, Tables of the Number of Binary Decompositions of All Even Numbers Less Than 200,000 into Prime Numbers and Lucky Numbers. Report LA-3106, Los Alamos Scientific Laboratory of the University of California, Los Alamos, NM, Sep 1964.

Crossrefs

Programs

  • Haskell
    a001031 n = sum (map a010051 gs) + fromEnum (1 `elem` gs)
       where gs = map (2 * n -) $ takeWhile (<= n) a008578_list
    -- Reinhard Zumkeller, Aug 28 2013
    
  • Mathematica
    nn = 10^2; ps = Boole[PrimeQ[Range[2*nn]]]; ps[[1]] = 1; Table[Sum[ps[[i]] ps[[2*n - i]], {i, n}], {n, nn}] (* T. D. Noe, Apr 11 2011 *)
  • PARI
    a(n)=my(s); forprime(p=2,n, if(isprime(2*n-p), s++)); if(isprime(2*n-1), s+1, s) \\ Charles R Greathouse IV, Feb 06 2017

Formula

Not very efficient: a(n) = (Sum_{i=1..n} (pi(i) - pi(i-1))*(pi(2*n-i) - pi(2*n-i-1))) + (pi(2*n-1) - pi(2*n-2)) + floor(1/n). - Wesley Ivan Hurt, Jan 06 2013
a(n) = floor((A096139(n)+1)/2). - Reinhard Zumkeller, Aug 28 2013

Extensions

More terms from Ray Chandler, Sep 19 2003

A002092 From a Goldbach conjecture: records in A185091.

Original entry on oeis.org

1, 3, 5, 7, 17, 29, 47, 61, 73, 83, 277, 317, 349, 419, 503, 601, 709, 829, 877, 1129, 1237, 1367, 1429, 1669, 1801, 2467, 2833, 2879, 3001, 3037, 3329, 3821, 4861, 5003, 5281, 5821, 5897, 6301, 6329, 6421, 6481, 6841, 7069, 7121, 7309, 7873, 8017, 8597, 8821
Offset: 1

Views

Author

Keywords

Comments

See A002091. The sequence gives the record values of q in the representations minimizing q of 2*k+1 = 2*p+q, p prime, q {1,prime}.
Checked up to 2*k = 10^13.

References

  • Brian H. Mayoh, On the second Goldbach conjecture. Nordisk Tidskr. Informations-Behandling 6, 1966, pp. 48-50.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Formula

a(n) = A185091((A002091(n)+1)/2).

Extensions

Comment added, a(19)-a(32) from Hugo Pfoertner, Sep 03 2011
a(33) from Jason Kimberley, a(34)-a(40) from Hugo Pfoertner, Sep 09 2011
a(41)-a(49) from Hugo Pfoertner, Sep 25 2011

A180007 Number of Goldbach partitions of 6^n.

Original entry on oeis.org

1, 4, 13, 49, 161, 656, 2751, 12505, 58482, 280348, 1374563, 6864809
Offset: 1

Views

Author

Jonathan Vos Post, Aug 06 2010

Keywords

Comments

Number of ways of writing 6^n as the sum of two odd primes, when the order does not matter. Number of ways writing 6^n as unordered sums of 2 primes. This is to 6 as A006307 is to 2 and as A065577 is to 10. This is the 6th row of the array A[k,n] = Number of ways writing k^n as unordered sums of 2 primes.
A061358(4^n) starts 1, 2, 5, 8, 22, 53, 151, 435, for n=1,2,... (bisection of A006307). A061358(8^n) starts 1, 5, 11, 53, 244, 1314, 7471, (tri-section of A006307). A061358(10^n) = A065577(n). A061358(12^n) = 1, 11, 53, 348, 2523, 20564... A061358(14^n) = 2, 9, 50, 330, 2924, 27225,... - R. J. Mathar, Aug 07 2010

Examples

			a(1) = 1 because 6^1 = 6 = 3+3.
a(2) = 4 because 6^2 = 36 = 5+31 = 7+29 = 13+23 = 17+19.
a(3) = 13 because 6^3 = 216 = 5+211 = 17+199 = 19+197 = 23+193 = 37+179 = 43+173 = 53+163 = 59+157 = 67+149 = 79+137 = 89+127 = 103+113 = 107+109.
		

Crossrefs

Programs

  • Maple
    A061358 := proc(n) local a,p ; a := 0 ; p := nextprime(floor((n-1)/2)) ; while p <= n do if isprime(n-p) then a := a+1 ; end if; p := nextprime(p) ; end do ; return a; end proc:
    A180007 := proc(n) A061358(6^n) ; end proc:
    for n from 1 do printf("%d,\n",A180007(n)) ; end do:
    # R. J. Mathar, Aug 07 2010
  • Mathematica
    Table[Count[Sort@ IntegerPartitions[6^n, {2}], {u_, v_} /; And[PrimeQ@ u, u != 2, PrimeQ@ v]], {n, 6}] (* Michael De Vlieger, Jun 02 2015 *)
  • PARI
    a(n)=my(t=6^n,s); forprime(p=2,t\2, if(isprime(t-p), s++)); s \\ Charles R Greathouse IV, Jun 02 2015

Formula

a(n) = A061358(6^n) = A061358(A000400(n)).

Extensions

a(5) corrected, 4 terms added by R. J. Mathar, Aug 07 2010
a(10)-a(12) from Manfred Scheucher, Jun 01 2015

A062305 Number of ways writing 2^n as a sum of a prime and a nonprime.

Original entry on oeis.org

0, 0, 1, 2, 2, 7, 8, 25, 38, 75, 128, 259, 458, 876, 1598, 3024, 5672, 10753, 20372, 38656, 73547, 140669, 268537, 514307, 986379, 1896755, 3650109, 7036061, 13580371, 26241380, 50765806, 98317489, 190597373, 369832498, 718266991, 1396138085, 2715823187, 5287080080
Offset: 0

Views

Author

Labos Elemer, Jul 05 2001

Keywords

Examples

			For n = 5: 2^5 = 32 = 31+1 = 2+30 = 5+27 = 7+25 = 11+21 = 17+15 = 23+9 so a(5) = 7.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(c = 0, m = 1 << n); forprime(p = 2, m-1, if(!isprime(m - p), c++)); c;} \\ Amiram Eldar, Jul 17 2024

Formula

a(n) = A062602(2^n) = number of prime+nonprime partitions of 2^n.
a(n) = 2^(n-1) - A006307(n) - A062306(n) for n >= 1. - Amiram Eldar, Jul 17 2024

Extensions

More terms from Dean Hickerson, Jul 23 2001
a(28)-a(32) from Sean A. Irvine, Mar 25 2023
a(33)-a(37) from Amiram Eldar, Jul 17 2024

A062306 Number of ways writing 2^n as a sum of two nonprime numbers.

Original entry on oeis.org

1, 0, 1, 4, 7, 19, 36, 82, 170, 362, 740, 1537, 3144, 6443, 13116, 26661, 54034, 109386, 221121, 446502, 900436, 1814910, 3655069, 7356483, 14796994, 29750473, 59789057, 120112121, 241218391, 484287995, 972034297, 1950544851, 3913243144, 7849331541, 15741697002
Offset: 1

Views

Author

Labos Elemer, Jul 05 2001

Keywords

Examples

			For n = 5: 2^5 = 32 = 4+28 = 6+26 = 8+24 = 10+22 = 12+20 = 14+18 = 16+16, so a(5) = 7.
		

Crossrefs

Formula

a(n) = A062610(2^n) = number of nonprime+nonprime partitions of 2^n.
a(n) = 2^(n-1) - A006307(n) - A062305(n). - Amiram Eldar, Jul 17 2024

Extensions

More terms from Dean Hickerson, Jul 23 2001
a(28)-a(32) from Sean A. Irvine, Mar 25 2023
a(33)-a(35) from Amiram Eldar, Jul 17 2024

A224928 Numbers of pairs {x, y} such that x <= y and triangular(x) + triangular(y) = 2^n.

Original entry on oeis.org

1, 1, 1, 0, 2, 0, 1, 0, 3, 0, 2, 0, 4, 0, 1, 0, 8, 0, 2, 0, 4, 0, 4, 0, 8, 0, 2, 0, 24, 0, 2, 0, 8, 0, 8, 0, 8, 0, 2, 0, 32, 0, 4, 0, 16, 0, 4, 0, 32, 0, 4, 0, 32, 0, 4, 0, 4, 0, 8, 0, 16, 0, 2, 0, 32, 0, 6, 0, 48, 0, 16, 0, 16, 0, 8, 0, 384, 0, 4, 0, 16, 0, 16, 0, 16, 0, 8, 0, 768, 0, 2, 0, 8, 0, 4, 0, 32, 0, 32, 0, 256
Offset: 0

Views

Author

Alex Ratushnyak, May 08 2013

Keywords

Comments

Conjectures:
1. a(n) = 0 for odd n > 1.
2. a(n) is even for even n > 14.

Examples

			2^1 = 1 + 1, the only representation of 2 as a sum of two triangular numbers, so a(1)=1.
2^4 = 16 = 1+15 = 6+10, two representations, so a(4) = 2.
2^8 = 256 = 3+253 = 66+190 = 120+136, so a(8) = 3.
2^12 = 4096 = 1+4095 = 91+4005 = 1540+2556 = 2016+2080, so a(12) = 4.
		

Crossrefs

Programs

  • C
    #include 
    #include 
    typedef unsigned long long U64;
    U64 isTriangular(U64 a) {      // ! Must be a <= (1<<63)
        U64 s = sqrt(a*2);
        if (a>=(1ULL<<63)) {
            if (a==(1ULL<<63)) return 0;
            printf("Error: a = %llu\n", a), exit(1);
        }
        return (s*(s+1)/2 == a);
    }
    int main() {
      U64 c, n, x, tx;
      for (n = 1; n; n+=n) {
        for (c = x = tx = 0; tx*2 <= n; ++x, tx+=x)
          if (isTriangular(n - tx))
            ++c;//, printf("(%llu+%llu) ", tx, n-tx);
        printf("%llu, ", c);
      }
      return 0;
    }
    
  • PARI
    A008441(n) = if(!n,n,sumdiv(4*n + 1, d, (d%4==1) - (d%4==3)));
    A052343(n) = if(!n,1,my(u=A008441(n)); ((u\2)+(u%2)));
    A224928(n) = A052343(2^n); \\ Antti Karttunen, May 24 2021

Formula

a(n) = A052343(2^n).

Extensions

More terms from Antti Karttunen, May 24 2021

A180041 Number of Goldbach partitions of (2n)^n.

Original entry on oeis.org

0, 2, 13, 53, 810, 20564, 274904, 6341424, 419586990
Offset: 1

Views

Author

Jonathan Vos Post, Aug 07 2010

Keywords

Comments

This is the main diagonal of the array mentioned in A180007, only considering even rows (as odd numbers cannot be the sums of two odd primes), namely A(2n, n) = number of ways of writing (2n)^n as the sum of two odd primes, when the order does not matter.

Examples

			a(1) = 0 because 2*1 = 2 is too small to be the sum of two primes.
a(2) = 2 because 4^2 = 16 = 3+13 = 5+11.
a(3) = 13 because 6^3 = 216 and A180007(3) = Number of Goldbach partitions of 6^3 = 13.
a(4) = 53 because 8^4 = 2^12 and A006307(12) = Number of ways writing 2^12 as unordered sums of 2 primes.
		

Crossrefs

Programs

  • Maple
    A180041 := proc(n) local a,m,p: if(n=1)then return 0:fi: a:=0: m:=(2*n)^n: p:=prevprime(ceil((m-1)/2)): while p > 2 do if isprime(m-p) then a:=a+1: fi: p := prevprime(p): od: return a: end: seq(A180041(n),n=1..5); # Nathaniel Johnston, May 08 2011
  • Mathematica
    f[n_] := Block[{c = 0, p = 3, m = (2 n)^n}, lmt = Floor[m/2] + 1; While[p < lmt, If[ PrimeQ[m - p], c++ ]; p = NextPrime@p]; c]; Do[ Print[{n, f@n // Timing}], {n, 8}] (* Robert G. Wilson v, Aug 10 2010 *)

Formula

a(n) = A061358((2*n)^n) = A061358(A062971(n)).

Extensions

a(6)-a(8) from Robert G. Wilson v, Aug 10 2010
a(9) from Giovanni Resta, Apr 15 2019

A195295 Number of Goldbach partitions of 4^n.

Original entry on oeis.org

0, 1, 2, 5, 8, 22, 53, 151, 435, 1314, 4239, 13705, 45746, 153850, 525236, 1817111, 6341424, 22336060, 79287664, 283277225, 1018369893
Offset: 0

Views

Author

Kausthub Gudipati, Sep 16 2011

Keywords

Comments

Bisection of A006307.

Crossrefs

A225536 Numbers of triples {x, y, z} such that z >= y > 1 and prime(x) + prime(y) * prime(z) = 2^n.

Original entry on oeis.org

0, 0, 0, 0, 1, 4, 5, 15, 22, 43, 65, 131, 204, 387, 635, 1136, 2048, 3727, 6794, 12296, 22601, 41746, 76778, 141923, 263414, 491925, 917269, 1718985, 3225496, 6067030, 11435208, 21593415, 40858139
Offset: 0

Views

Author

Alex Ratushnyak, May 10 2013

Keywords

Examples

			2^4 = 16 = 7 + 3*3, so a(4) = 1.
2^5 = 32 = 7 + 5*5 = 11 + 3*7 = 17 + 3*5 = 23 + 3*3, so a(5) = 4.
		

Crossrefs

Programs

  • C
    #include 
    #include 
    #define TOP (1ULL<<32)
    int main() {
      unsigned long long i, j, k, n, pp = 0, x, px, y, py, sr;
      unsigned int *primes = (unsigned int*)malloc(TOP/4);
      char *c = (char*)malloc(TOP/2);
      memset(c, 0, TOP/2);
      for (c[0] = i = 3; i < TOP; i+=2)
        if (c[i>>1]==0)
          for (primes[pp++]=i, j=i*i>>1; j>1] == 0) ++k; break; }
        }
        printf("%llu, ", k);
      }
    }
Showing 1-10 of 10 results.