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.

A007963 Number of (unordered) ways of writing 2n+1 as a sum of 3 odd primes.

This page as a plain text file.
%I A007963 #54 Aug 03 2024 16:44:02
%S A007963 0,0,0,0,1,1,2,2,3,3,4,4,5,6,7,6,8,7,9,10,10,10,11,12,12,14,16,14,16,
%T A007963 16,16,18,20,20,20,21,21,21,27,24,25,28,27,28,33,29,32,35,34,30,37,36,
%U A007963 34,42,38,36,46,42,42,50,46,47,53,50,45,56,54,46,62,53,48,64,59,55,68,61,59,68
%N A007963 Number of (unordered) ways of writing 2n+1 as a sum of 3 odd primes.
%C A007963 Ways of writing 2n+1 as p+q+r where p,q,r are odd primes with p <= q <= r.
%C A007963 The two papers of Helfgott appear to provide a proof of the Odd Goldbach Conjecture that every odd number greater than five is the sum of three primes. (The paper is still being reviewed.) - _Peter Luschny_, May 18 2013; _N. J. A. Sloane_, May 19 2013
%D A007963 George E. Andrews, Number Theory (NY, Dover, 1994), page 111.
%D A007963 Ivars Peterson, The Mathematical Tourist (NY, W. H. Freeman, 1998), pages 35-37.
%D A007963 Paulo Ribenboim, "VI, Goldbach's famous conjecture," The New Book of Prime Number Records, 3rd ed. (NY, Springer, 1996), pages 291-299.
%H A007963 T. D. Noe, <a href="/A007963/b007963.txt">Table of n, a(n) for n = 0..10000</a>
%H A007963 H. A. Helfgott, <a href="http://arxiv.org/abs/1205.5252">Minor arcs for Goldbach's problem</a>, arXiv:1205.5252 [math.NT], 2012.
%H A007963 H. A. Helfgott, <a href="http://arxiv.org/abs/1305.2897">Major arcs for Goldbach's theorem</a>, arXiv:1305.2897 [math.NT], 2013.
%H A007963 H. A. Helfgott, <a href="http://arxiv.org/abs/1312.7748">The ternary Goldbach conjecture is true</a>, arxiv:1312.7748 [math.NT], 2013.
%H A007963 H. A. Helfgott, <a href="http://arxiv.org/abs/1404.2224">The ternary Goldbach problem</a>, arXiv:1404.2224 [math.NT], 2014.
%H A007963 F. Smarandache, <a href="http://www.gallup.unm.edu/~smarandache/OPNS.pdf">Only Problems, Not Solutions!</a>.
%H A007963 <a href="/index/Go#Goldbach">Index entries for sequences related to Goldbach conjecture</a>
%e A007963 a(10) = 4 because 21 = 3+5+13 = 3+7+11 = 5+5+11 = 7+7+7.
%p A007963 A007963 := proc(n)
%p A007963     local a,i,j,k,p,q,r ;
%p A007963     a := 0 ;
%p A007963     for i from 2 do
%p A007963         p := ithprime(i) ;
%p A007963         for j from i do
%p A007963             q := ithprime(j) ;
%p A007963             for k from j do
%p A007963                 r := ithprime(k) ;
%p A007963                 if p+q+r = 2*n+1 then
%p A007963                     a := a+1 ;
%p A007963                 elif p+q+r > 2*n+1 then
%p A007963                     break;
%p A007963                 end if;
%p A007963             end do:
%p A007963             if p+2*q > 2*n+1 then
%p A007963                 break;
%p A007963             end if;
%p A007963         end do:
%p A007963         if 3*p > 2*n+1 then
%p A007963             break;
%p A007963         end if;
%p A007963     end do:
%p A007963     return a;
%p A007963 end proc:
%p A007963 seq(A007963(n),n=0..30) ; # _R. J. Mathar_, Sep 06 2014
%t A007963 nn = 75; ps = Prime[Range[2, nn + 1]]; c = Flatten[Table[If[i >= j >= k, i + j + k, 0], {i, ps}, {j, ps}, {k, ps}]]; Join[{0, 0, 0, 0}, Transpose[Take[Rest[Sort[Tally[c]]], nn+2]][[2]]] (* _T. D. Noe_, Apr 08 2014 *)
%o A007963 (Sage)
%o A007963 def A007963(n):
%o A007963     c = 0
%o A007963     for p in Partitions(n, length = 3):
%o A007963         b = True
%o A007963         for t in p:
%o A007963             b = is_prime(t) and t > 2
%o A007963             if not b: break
%o A007963         if b : c = c + 1
%o A007963     return c
%o A007963 [A007963(2*n+1) for n in (0..77)]   # _Peter Luschny_, May 18 2013
%o A007963 (Perl) use ntheory ":all"; sub a007963 { my($n,$c)=(shift,0); forpart { $c++ if vecall { is_prime($_) } @_; } $n,{n=>3,amin=>3}; $c; }
%o A007963 say "$_ ",a007963(2*$_+1) for 0..100; # _Dana Jacobsen_, Mar 19 2017
%o A007963 (PARI) a(n)=my(k=2*n+1,s,t); forprime(p=(k+2)\3,k-6, t=k-p; forprime(q=t\2,min(t-3,p), if(isprime(t-q), s++))); s \\ _Charles R Greathouse IV_, Mar 20 2017
%Y A007963 Cf. A068307, A087916, A294294 (lower bound of scatterplot), A294357, A294358 (records).
%K A007963 nonn
%O A007963 0,7
%A A007963 R. Muller
%E A007963 Corrected and extended by _David W. Wilson_