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

A068307 From Goldbach problem: number of decompositions of n into a sum of three primes.

Original entry on oeis.org

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

Views

Author

Naohiro Nomoto, Feb 24 2002

Keywords

Comments

For even n > 2, a(n) = A061358(n-2). - Reinhard Zumkeller, Aug 08 2009
Vinogradov proved that every sufficiently large odd number is the sum of three primes. - T. D. Noe, Mar 27 2013
The two Helfgott papers show that every odd number greater than 5 is the sum of three primes (this is the Odd Goldbach Conjecture). - T. D. Noe, May 14 2013, N. J. A. Sloane, May 18 2013

Examples

			a(6) = 1 because 6 = 2+2+2,
a(9) = 2 because 9 = 2+2+5 = 3+3+3,
a(15) = 3 because 15 = 2+2+11 = 3+5+7 = 5+5+5,
a(17) = 4 because 17 = 2+2+13 = 3+3+11 = 3+7+7 = 5+5+7.
- _Zak Seidov_, Jun 29 2017
		

Crossrefs

First occurrence: A139321. Records: A139322.
Column k=3 of A117278.

Programs

Formula

a(n) = Sum_{k=1..floor(n/3)} Sum_{i=k..floor((n-k)/2)} A010051(i) * A010051(k) * A010051(n-i-k). - Wesley Ivan Hurt, Mar 26 2019
a(n) = [x^n y^3] Product_{k>=1} 1/(1 - y*x^prime(k)). - Ilya Gutkovskiy, Apr 18 2019

Extensions

More terms from Vladeta Jovovic, Mar 10 2002

A083338 Number of partitions of odd numbers into three primes and of even numbers into two primes.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Apr 24 2003

Keywords

Comments

a(n) > 0 for all n iff Goldbach's conjectures hold.

Crossrefs

Programs

  • Mathematica
    f[n_] := Length@ IntegerPartitions[n, If[ OddQ@ n, {3}, {2}], Prime@ Range@ PrimePi@ n]; Array[f, 92] (* Robert G. Wilson v, Nov 28 2012 *)

Formula

a(n) = if n is even then A045917(n/2) else A054860((n-1)/2).
For even n: a(n) = A061358(n); for odd n: a(n) = A068307(n). - Antti Karttunen, Sep 14 2017

A102605 Number of ways of writing 2n+1 as p+q+r where p,q,r are primes with p < q < r, offset=0.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 6, 9, 8, 8, 11, 11, 10, 13, 13, 12, 14, 15, 13, 18, 17, 14, 21, 19, 17, 25, 20, 21, 26, 25, 22, 30, 28, 21, 32, 31, 23, 37, 32, 27, 39, 36, 32, 43, 41, 36, 45, 44, 35, 51, 48, 34, 54, 48, 36, 59, 50, 43, 60, 55, 46, 61
Offset: 0

Views

Author

Zak Seidov, Jan 29 2005

Keywords

Comments

The graph of this function shows two main branches, each with further subdivisions. It seems that the main branches result from the fact that values a(3k+1) are in the mean roughly 30% lower than values a(3k) and a(3k+2). This can be explained by the fact that the sum of 3 primes (with equal probability of being congruent to 1 or to 5 mod 6) is congruent to 3 (mod 6) in only 2 out of 8 cases, and congruent to 1 or to 5 (mod 6) in 3 out of 8 cases, for each of these two residues. Analyzing the frequencies of the possible residues mod 30 explains the further sub-branches: A sum of 3 primes is congruent to 1, 3, ..., 29 (mod 30) in (42, 29, 33, 39, 29, 36, 36, 30, 39, 30, 39, 30, 36, 37, 27) out of 512 cases. - M. F. Hasler, Oct 27 2017

Examples

			a(19) = 6 because 2*19+1 = 39 and 39 = 3+5+31 = 3+7+29 = 3+13+23 = 3+17+19 = 5+11+23 = 7+13+19.
		

Crossrefs

Number of ways of writing 2n+1 as p+q+r where p, q, r are primes with p <= q <= r gives A054860.
Bisection of A125688 (odd part). - Alois P. Heinz, Nov 14 2012

Programs

  • PARI
    A102605(n,s=0)={forprime(p=1,(n*=2)\3,my(d=n-p);forprime(q=p+1,d\2,isprime(d+1-q)&&s++));s} \\ M. F. Hasler, Oct 27 2017

A288574 Total number of distinct primes in all representations of 2*n+1 as a sum of 3 odd primes.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 4, 4, 6, 7, 9, 10, 12, 15, 17, 16, 19, 19, 23, 25, 26, 26, 28, 33, 32, 35, 43, 39, 41, 45, 45, 48, 54, 55, 52, 60, 59, 56, 75, 67, 67, 81, 74, 76, 92, 83, 85, 100, 96, 81, 106, 103, 91, 121, 108, 98, 131, 120, 116, 143, 133, 129, 151, 144, 124, 163
Offset: 0

Views

Author

Keywords

Comments

That is, a representation 2n+1 = p+p+p counts as 1, as p+p+q counts as 2, and p+q+r counts as 3. If each representation is counted once, we simply get A007963.

Crossrefs

A288573 appears to be an erroneous version of this sequence.

Programs

  • Maple
    A288574 := proc(n)
        local a, i, j, k, p, q, r,pqr ;
        a := 0 ;
        for i from 2 do
            p := ithprime(i) ;
            for j from i do
                q := ithprime(j) ;
                for k from j do
                    r := ithprime(k) ;
                    if p+q+r = 2*n+1 then
                        pqr := {p,q,r} ;
                        a := a+nops(pqr) ;
                    elif p+q+r > 2*n+1 then
                        break;
                    end if;
                end do:
                if p+2*q > 2*n+1 then
                    break;
                end if;
            end do:
            if 3*p > 2*n+1 then
                break;
            end if;
        end do:
        return a;
    end proc:
    seq(A288574(n),n=0..80) ; # R. J. Mathar, Jun 29 2017
  • Mathematica
    Table[x = 2 n + 1; max = PrimePi[x]; Total[Length /@ Tally /@ DeleteDuplicates[Sort /@ Select[Tuples[Range[2, max], 3], Prime[#[[1]]] + Prime[#[[2]]] + Prime[#[[3]]] == x &]]], {n, 0, 100}] (* Robert Price, Apr 22 2025 *)
  • PARI
    a(n)={my(p,q,r,cnt);n=2*n+1;
    forprime(p=3,n\3,forprime(q=p,(n-p)\2,
    if(isprime(r=n-p-q), cnt+=if(p===q&&p==r,1,if(p==q||q==r,2,3)))));cnt}
    \\ Franklin T. Adams-Watters, Jun 28 2017
    
  • Python
    from sympy import primerange, isprime
    def a(n):
        n=2*n + 1
        c=0
        for p in primerange(3, n//3 + 1):
            for q in primerange(p, (n - p)//2 + 1):
                r=n - p - q
                if isprime(r): c+=1 if p==q and p==r else 2 if p==q or q==r else 3
        return c
    print([a(n) for n in range(66)]) # Indranil Ghosh, Jun 29 2017

A083339 a(n) is the number of distinct prime factors of n that occur in partitions into two primes when n is even and into three primes when n is odd.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 2, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 2, 1, 2, 0, 0, 1, 2, 0, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 2, 1, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 1, 2, 0, 2, 0, 0, 0, 1, 1, 0, 0, 2, 1, 2, 0, 0, 0, 2, 0, 2, 1, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 24 2003

Keywords

Comments

Number of distinct prime factors of n that occur in prime-partitions confirming Goldbach's conjectures. (The original name of this sequence.)
Conjecture: Apart from k=2, A070826(k): 1, 3, 15, 105, 1155, 15015, 255255, gives the positions of records (each equal to k-1). This follows from the conjectured formula. - Antti Karttunen, Sep 14 2017

Examples

			For n = 14 = 2*7 = 3 + 11 = 7 + 7, only one factor of 14 occurs, thus a(14) = 1.
For n = 15 = 3*5 = 2 + 2 + 11 = 3 + 5 + 7 = 5 + 5+ 5, both factors of 15 occur, thus a(15) = 2.
For n = 105 = 3*5*7, with 35 different partitions into three primes, the partition 97 + 5 + 3 contains the prime factors 3 and 5, while the partition 79 + 19 + 7 contains 7, thus all three prime factors of 115 occur and a(115) = 3.
For n = 1155 = 3*5*7*11, among 891 different partitions into three primes, the following four partitions: 1129 + 23 + 3 = 1129 + 19 + 7 = 1109 + 41 + 5 = 1103 + 41 + 11 each have either 3, 5, 7 or 11 as one of their parts, thus a(1155) = 4.
		

Crossrefs

Programs

  • Mathematica
    Table[Count[Union@ Flatten@ Select[IntegerPartitions[n, {2 + Boole[OddQ@ n]}], AllTrue[#, PrimeQ] &], p_ /; Divisible[n, p]], {n, 105}] (* Michael De Vlieger, Sep 16 2017 *)

Formula

If n is even, a(n) = A010051(n/2), if n is an odd prime, a(n) = 0, and for odd composites (conjecturally), a(n) = A001221(n). - Antti Karttunen, Sep 14 2017

Extensions

Name edited and two further examples added by Antti Karttunen, Sep 14 2017

A218797 Number of ways to write 2n - 1 as p + q + r with p <= q <= r and p, q, r, p^2 + q^2 + r^2 all prime.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 1, 2, 0, 1, 2, 2, 1, 3, 2, 3, 1, 2, 1, 1, 2, 2, 2, 1, 2, 1, 2, 4, 1, 3, 2, 2, 2, 2, 2, 2, 4, 3, 3, 3, 2, 4, 4, 3, 0, 2, 1, 1, 1, 1, 2, 2, 3, 2, 4, 4, 3, 3, 2, 3, 4, 2, 2, 3, 2, 1, 3, 3, 1, 2, 2, 5, 1, 4, 2, 2, 1, 1, 6, 3, 1, 5, 1, 1, 5, 4, 1, 4, 1, 2, 6, 2, 4, 2, 2, 2, 1, 4, 4
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 05 2012

Keywords

Comments

Conjecture: a(n) > 0 for all n=1715,1716,....
This conjecture is stronger than the weak Goldbach conjecture. It has been verified for n up to 500,000. Those 0

Examples

			a(7)=2 since 13=3+3+7=3+5+5, and both 3^2+3^2+7^2=67 and 3^2+5^2+5^2=59 are primes.
		

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[n-Prime[j]-Prime[k]]==True&&PrimeQ[Prime[j]^2+Prime[k]^2+(n-Prime[j]-Prime[k])^2]==True,1,0],{j,1,PrimePi[n/3]},{k,j,PrimePi[(n-Prime[j])/2]}]
    Do[Print[n," ",a[2n-1]],{n,1,10000}]
Showing 1-6 of 6 results.