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 11 results. Next

A125688 Number of partitions of n into three distinct primes.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 30 2006

Keywords

Comments

a(A124868(n)) = 0; a(A124867(n)) > 0;
a(A125689(n)) = n and a(m) <> n for m < A125689(n).

Examples

			a(42) = #{2+3+37, 2+11+29, 2+17+23} = 3.
		

Crossrefs

Column k=3 of A219180. - Alois P. Heinz, Nov 13 2012

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, [1,0$3], `if`(i<1, [0$4],
           zip((x, y)->x+y, b(n, i-1), [0, `if`(ithprime(i)>n, [0$3],
           b(n-ithprime(i), i-1)[1..3])[]], 0)))
        end:
    a:= n-> b(n, numtheory[pi](n))[4]:
    seq(a(n), n=1..100);  # Alois P. Heinz, Nov 15 2012
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, {1, 0, 0, 0}, If[i<1, {0, 0, 0, 0}, Plus @@ PadRight[{b[n, i-1], Join[{0}, If[Prime[i]>n, {0, 0, 0}, Take[b[n-Prime[i], i-1], 3]]]}]]]; a[n_] := b[n, PrimePi[n]][[4]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 30 2014, after Alois P. Heinz *)
    dp3Q[{a_,b_,c_}]:=Length[Union[{a,b,c}]]==3&&AllTrue[{a,b,c},PrimeQ]; Table[ Count[IntegerPartitions[n,{3}],?dp3Q],{n,100}] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale, Jan 30 2019 *)
  • PARI
    a(n)=my(s);forprime(p=n\3,n-4,forprime(q=(n-p)\2+1,min(n-p,p-1),if(isprime(n-p-q),s++)));s \\ Charles R Greathouse IV, Aug 27 2012

Formula

From Alois P. Heinz, Nov 22 2012: (Start)
G.f.: Sum_{0
a(n) = [x^n*y^3] Product_{i>=1} (1+x^prime(i)*y). (End)
a(n) = Sum_{k=1..floor((n-1)/3)} Sum_{i=k+1..floor((n-k-1)/2)} A010051(i) * A010051(k) * A010051(n-i-k). - Wesley Ivan Hurt, Mar 29 2019

A283762 Expansion of (x + Sum_{k>=1} x^prime(k))^3.

Original entry on oeis.org

0, 0, 0, 1, 3, 6, 7, 9, 9, 13, 12, 15, 9, 15, 12, 22, 15, 24, 12, 27, 18, 34, 18, 36, 15, 42, 24, 45, 15, 42, 12, 51, 24, 52, 18, 60, 21, 66, 24, 58, 15, 69, 18, 75, 30, 75, 24, 87, 21, 93, 36, 91, 24, 99, 18, 108, 36, 97, 18, 108, 21, 126, 42, 111, 21, 135, 30, 141, 36, 112, 18, 150, 30, 153, 42, 138, 33, 177, 30, 171, 42
Offset: 0

Author

Ilya Gutkovskiy, Mar 16 2017

Keywords

Comments

Number of ways to write n as an ordered sum of 3 noncomposite numbers (1 together with the primes) (A008578).
a(2k+1) > 0 for all k > 0 (from the ternary Goldbach's conjecture, proved by H. A. Helfgott).

Examples

			a(6) = 7 because we have [3, 2, 1], [3, 1, 2], [2, 3, 1], [2, 2, 2], [2, 1, 3], [1, 3, 2] and [1, 2, 3].
		

Crossrefs

Programs

  • Mathematica
    nmax = 80; CoefficientList[Series[(x + Sum[x^Prime[k], {k, 1, nmax}])^3, {x, 0, nmax}], x]
  • PARI
    concat([0, 0, 0], Vec((x + sum(k=1, 80, x^prime(k)))^3 + O(x^81))) \\ Indranil Ghosh, Mar 16 2017

Formula

G.f.: (x + Sum_{k>=1} x^prime(k))^3.

A068873 Smallest prime which is a sum of n distinct primes.

Original entry on oeis.org

2, 5, 19, 17, 43, 41, 79, 83, 127, 131, 199, 197, 283, 281, 379, 389, 499, 509, 643, 641, 809, 809, 983, 971, 1171, 1163, 1381, 1373, 1609, 1607, 1861, 1861, 2137, 2137, 2437, 2441, 2749, 2767, 3109, 3109, 3457, 3457, 3833, 3847, 4243, 4241, 4663, 4679, 5119
Offset: 1

Author

Amarnath Murthy, Mar 19 2002

Keywords

Comments

Conjectured terms a(50)-a(76): 5147, 5623, 5591, 6079, 6101, 6599, 6607, 7151, 7151, 7699, 7699, 8273, 8293, 8893, 8893, 9521, 9547, 10211, 10223, 10889, 10891, 11597, 11617, 12343, 12373, 13099, 13127. - Jean-François Alcover, Apr 22 2020

Examples

			a(3) = 19 as 19 is the smallest prime which can be expressed as the sum of three primes as 19 = 3 + 5 + 11.
a(4) = 17= 2+3+5+7. a(2)=A038609(1). a(3)=A124867(7). Further examples in A102330.
		

References

  • Shantanu Dey & Moloy De, Two conjectures on prime numbers, Journal of Recreational Mathematics, Vol. 36 (3), pp 205-206. Baywood Publ. Co, Amityville NY 2011.

Crossrefs

Programs

  • Maple
    # Number of ways to write n as a sum of k distinct primes, the smallest
    # being smalp
    sumkprims := proc(n,k,smalp)
        option remember;
        local a,res,pn;
        res := n-smalp ;
        if res < 0 then
            return 0;
        elif res > 0 and k <=0 then
            return 0;
        elif res = 0 and k = 1 then
            return 1;
        else
            pn := nextprime(smalp) ;
            a := 0 ;
            while pn <= res do
                a := a+procname(res,k-1,pn) ;
                pn := nextprime(pn) ;
            end do:
            a ;
        end if;
    end proc:
    # Number of ways of writing n as a sum of k distinct primes
    A000586k := proc(n,k)
        local a,i,smalp ;
        a := 0 ;
        for i from 1 do
            smalp := ithprime(i) ;
            if k*smalp > n then
                return a;
            end if;
            a := a+sumkprims(n,k,smalp) ;
        end do:
    end proc:
    # Smallest prime which is a sum of n distinct primes
    A068873 := proc(n)
        local a,i;
        a := A007504(n) ;
        a := nextprime(a-1) ;
        for i from 1 do
            if A000586k(a,n) > 0 then
                return a;
            end if;
            a := nextprime(a) ;
        end do:
    end proc: # R. J. Mathar, May 04 2014
  • PARI
    a(n)=
    {
        my(P=primes(n), k=n, t, res = oo);
        while(1,
            forvec(v=vector(n-1, i, [1, k-1]),
                t=sum(i=1, n-1, P[v[i]])+P[k];
                if(isprime(t),
    		res = min(res, t);
    	   )
            ,
                2 \\ flag: only strictly increasing vectors v
            );
            P=concat(P, nextprime(P[k]+1));
            k++;
    	if(P[k] + sum(i = 1+bitand(n,1), n-1+bitand(n,1), P[i]) > res,
    		return(res)
    	)
        );
    }
    \\ Charles R Greathouse IV, Sep 19 2015; corrected by David A. Corneth, May 12 2025

Formula

Min(a(n), A073619(n)) = A007504(n) for n > 1. - Jonathan Sondow, Jul 10 2012

Extensions

More terms from Sascha Kurz, Feb 03 2003
Corrected by Ray Chandler, Feb 02 2005

A124868 Natural numbers that are not the sum of 3 distinct primes.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 17
Offset: 1

Author

Alexander Adamchuk, Nov 11 2006

Keywords

Comments

(Conjectured) Every number n > 17 is the sum of 3 distinct primes. a(n) is the complement of A124867(n) = {10, 12, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, ...}, numbers that are the sum of 3 distinct primes.
A125688(a(n)) = 0. - Reinhard Zumkeller, Nov 30 2006

Crossrefs

Cf. A124867 (numbers that are the sum of 3 distinct primes), A068307.

A224534 Prime numbers that are the sum of three distinct prime numbers.

Original entry on oeis.org

19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307
Offset: 1

Author

T. D. Noe, Apr 15 2013

Keywords

Comments

Similar to Goldbach's weak conjecture.
Primes in A124867, and by the comment in A124867 also the set of all primes >=19. - R. J. Mathar, Apr 19 2013
"Goldbach's original conjecture (sometimes called the 'ternary' Goldbach conjecture), written in a June 7, 1742 letter to Euler, states 'at least it seems that every number that is greater than 2 is the sum of three primes' (Goldbach 1742; Dickson 2005, p. 421). Note that here Goldbach considered the number 1 to be a prime, a convention that is no longer followed." [Weisstein] - Jonathan Vos Post, May 15 2013

Examples

			19 = 3 + 5 + 11.
		

Crossrefs

Cf. A002372, A002375, A024684 (number of sums), A224535, A166063, A166061, A071621.

Programs

  • Mathematica
    Union[Select[Total /@ Subsets[Prime[Range[2, 30]], {3}], PrimeQ]]

A238397 Numbers of the form pq + qr + rp where p, q and r are distinct primes (sorted sequence without duplicates).

Original entry on oeis.org

31, 41, 59, 61, 71, 87, 91, 101, 103, 113, 119, 121, 129, 131, 143, 151, 161, 167, 171, 185, 191, 199, 211, 213, 215, 221, 227, 239, 241, 243, 247, 251, 263, 269, 271, 275, 281, 293, 297, 299, 301, 311, 321, 327, 331, 339, 341, 343, 347, 355
Offset: 1

Author

Jean-François Alcover, Feb 26 2014

Keywords

Comments

Numbers of the form e2(p, q, r) for distinct primes p, q, r, where e2 is the elementary symmetric polynomial of degree 2. Other sequences are obtained with different numbers of distinct primes and degrees: A000040 for 1 prime, A038609 and A006881 for 2 primes, A124867, this sequence, and A007304 for 3 primes. The 4-prime sequences are not presently in the OEIS with the exception of A046386. - Charles R Greathouse IV, Feb 26 2014

Examples

			71 = 3*5 + 5*7 + 7*3 = 2*3 + 3*13 + 13*2 is in the sequence (only once, though 2 solutions exist).
		

Crossrefs

Programs

  • Mathematica
    terms = 50; dm (* initial number of primes *) = 10; f[p_, q_, r_] := p*q + q*r + r*p; Clear[A238397]; A238397[m_] := A238397[m] = Take[u = Union[f @@@ Subsets[Prime /@ Range[m], {3}]], Min[Length[u], terms]]; A238397[dm]; A238397[m = 2*dm]; While[Print["m = ", m]; A238397[m] != A238397[m - dm], m = m + dm]; A238397[m]
  • PARI
    is(n)=forprime(r=(sqrtint(3*n-3)+5)\3, (n-6)\5, forprime(q= sqrtint(r^2+n)-r+1, min((n-2*r)\(r+2), r-2), if((n-q*r)%(q+r)==0 && isprime((n-q*r)/(q+r)), return(1)))); 0 \\ Charles R Greathouse IV, Feb 26 2014
    
  • PARI
    list(n)=my(v=List()); forprime(r=5, (n-6)\5, forprime(q=3, min((n-2*r)\(r+2), r-2), my(S=q+r, P=q*r); forprime(p=2, min((n-P)\S, q-1), listput(v, p*S+P)))); Set(v) \\ Charles R Greathouse IV, Feb 26 2014

A177697 Sums of 3 distinct primorials.

Original entry on oeis.org

9, 33, 37, 38, 213, 217, 218, 241, 242, 246, 2313, 2317, 2318, 2341, 2342, 2346, 2521, 2522, 2526, 2550, 30033, 30037, 30038, 30061, 30062, 30066, 30241, 30242, 30246, 30270, 32341, 32342, 32346, 32370, 32550, 510513, 510517, 510518, 510541, 510542
Offset: 1

Author

Jonathan Vos Post, May 11 2010

Keywords

Comments

This is to numbers that are the sum of 3 different primes (A124867) as primorials (A002110) are to primes (A000040). The subsequence of primes among these sums of 3 distinct primorials begins: 37, 241, 2341, 2521, 30241, 32341, 512821, 540541.

Examples

			9 = 6+2+1
33 = 30+2+1
37 = 30+6+1
38 = 30+6+2
213 = 210+2+1
		

Programs

  • Mathematica
    Take[Total/@Subsets[Join[{1},FoldList[Times,Prime[Range[10]]]],{3}]// Union,40] (* Harvey P. Dale, Nov 07 2017 *)

Formula

{a(n)} = {A002110(i) + A002110(j) + A002110(k) for i =/= j, i =/= k, j =/= k}.

A224535 Odd numbers that are the sum of three distinct prime numbers.

Original entry on oeis.org

15, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, 131, 133, 135
Offset: 1

Author

T. D. Noe, Apr 15 2013

Keywords

Comments

Odd terms in A124867. - R. J. Mathar, Jun 09 2014

Examples

			15 = 3 + 5 + 7.
		

Crossrefs

Cf. A224534 (primes in this sequence).

Programs

  • Mathematica
    Union[Total /@ Subsets[Prime[Range[2, 30]], {3}]]

Extensions

"Odd" added by Irina Gerasimova, Apr 15 2013

A177709 Sums of 4 distinct primorials.

Original entry on oeis.org

39, 219, 243, 247, 248, 2319, 2343, 2347, 2348, 2523, 2527, 2528, 2551, 2552, 2556, 30039, 30063, 30067, 30068, 30243, 30247, 30248, 30271, 30272, 30276, 32343, 32347, 32348, 32371, 32372, 32376, 32551, 32552, 32556, 32580, 510519, 510543
Offset: 1

Author

Jonathan Vos Post, May 11 2010

Keywords

Comments

This is to numbers that are the sum of 4 different primes (A177708) as primorials (A002110) are to primes (A000040). The subsequence of primes among these sums of 4 distinct primorials begins: 2347, 2551, 30271, 32371, 510751. The subsequence of nontrivial powers a^b with b>1 begin: a(3) = 243, a(24) = 30276 = 30030+210+30+6 = 2^2 x 3^2 x 29^2.

Examples

			a(1) = 39 = 30+6+2+1
a(2) = 219 = 210+6+2+1
a(3) = 243 = 210+30+2+1 = 3^5
a(4) = 247 = 210+30+6+1
a(5) = 248 = 210+30+6+2.
		

Formula

{a(n)} = {A002110(i) + A002110(j) + A002110(k)+ A002110(L) for distinct i, j, k, L}.

Extensions

Corrected (2348 inserted) by R. J. Mathar, May 15 2010

A178041 Number of ways to represent the n-th prime (which has a nonzero number of such representations) as the sum of 4 distinct primes.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 6, 6, 8, 10, 13, 14, 13, 18, 21, 17, 21, 30, 21, 32, 23, 37, 27, 45, 35, 34, 54, 43, 60, 61, 67, 44, 52, 55, 79, 58, 89, 57, 92, 100, 111, 69, 119, 76, 83, 122, 91, 89, 94, 102, 147, 146, 106, 159, 116, 176, 125, 190, 119, 195, 202, 136, 230, 148, 154, 222
Offset: 1

Author

Jonathan Vos Post, May 17 2010

Keywords

Examples

			a(1) = 1 because 17 = 2+3+5+7 is the unique solution for the smallest such prime.
a(2) = 2 because 23 = 2+3+5+13 = 2+3+7+11 are the only two solutions for the 2nd smallest such prime.
a(3) = 3 because 29 = 2+3+5+19 = 2+3+7+17 = 2+3+11+13 are the only 3 solutions for the 3rd smallest such prime.
a(4) = 3 because 31 = 2+3+7+19 = 2+5+7+17 = 2+5+11+13 are the only 3 solutions for the 4th smallest such prime.
a(5) = 5 because 37 = 2+3+13+19 = 2+5+7+23 = 2+5+11+19 = 2+5+13+17 = 2+7+11+17 are the only 5 solutions for the 5th smallest such prime.
		

Crossrefs

Cf. A000040, A038609 (sum of 2 distinct primes), A124867 (sum of 3 distinct primes), A124868 (not the sum of 3 distinct primes), A124884 (not the sum of n distinct primes).

Programs

  • Mathematica
    max=367;lim=PrimePi[max];p4=Sort[Total/@Subsets[Prime[Range[lim]],{4}]];p4p=Select[p4,PrimeQ[#]&&#<=max&]; s={};Do[c=Count[p4p,Prime[p]];If[c>0,AppendTo[s,c]],{p,lim}];s (* James C. McMahon, Jan 11 2025 *)

Extensions

Extended by Zak Seidov
Showing 1-10 of 11 results. Next