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.

A117929 Number of partitions of n into 2 distinct primes.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 0, 2, 1, 2, 1, 2, 0, 3, 1, 2, 0, 2, 0, 3, 1, 2, 1, 3, 0, 4, 0, 1, 1, 3, 0, 4, 1, 3, 1, 3, 0, 5, 1, 4, 0, 3, 0, 5, 1, 3, 0, 3, 0, 6, 1, 2, 1, 5, 0, 6, 0, 2, 1, 5, 0, 6, 1, 4, 1, 5, 0, 7, 0, 4, 1, 4, 0, 8, 1, 4, 0, 4, 0, 9, 1, 4, 0, 4, 0, 7, 0, 3, 1, 6, 0, 8, 1, 5, 1
Offset: 1

Views

Author

Emeric Deutsch, Apr 03 2006

Keywords

Comments

Number of distinct rectangles with prime length and width such that L + W = n, W < L. For example, a(16) = 2; the two rectangles are 3 X 13 and 5 X 11. - Wesley Ivan Hurt, Oct 29 2017

Examples

			a(24) = 3 because we have [19,5], [17,7] and [13,11].
		

Crossrefs

Cf. A010051, A045917, A061358, A073610, A166081 (positions of 0), A077914 (positions of 2), A080862 (positions of 6).
Column k=2 of A219180. - Alois P. Heinz, Nov 13 2012

Programs

  • Maple
    g:=sum(sum(x^(ithprime(i)+ithprime(j)),i=1..j-1),j=1..35): gser:=series(g,x=0,130): seq(coeff(gser,x,n),n=1..125);
    # alternative
    A117929 := proc(n)
        local a,i,p ;
        a := 0 ;
        p := 2 ;
        for i from 1 do
            if 2*p >= n then
                return a;
            end if;
            if isprime(n-p) then
                a := a+1 ;
            end if;
            p := nextprime(p) ;
        end do:
    end proc:
    seq(A117929(n),n=1..80) ; # R. J. Mathar, Oct 01 2021
  • Mathematica
    l = {}; For[n = 1, n <= 1000, n++, c = 0; For[k = 1, Prime[k] < n/2, k++, If[PrimeQ[n - Prime[k]], c = c + 1] ]; AppendTo[l, c] ] l (* Jake Foster, Oct 27 2008 *)
    Table[Count[IntegerPartitions[n,{2}],?(AllTrue[#,PrimeQ]&&#[[1]]!= #[[2]] &)],{n,120}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale, Jul 26 2020 *)
  • PARI
    a(n)=my(s);forprime(p=2,(n-1)\2,s+=isprime(n-p));s \\ Charles R Greathouse IV, Feb 26 2014
    
  • Python
    from sympy import sieve
    from collections import Counter
    from itertools import combinations
    def aupton(max):
        sieve.extend(max)
        a = Counter(c[0]+c[1] for c in combinations(sieve._list, 2))
        return [a[n] for n in range(1, max+1)]
    print(aupton(105)) # Michael S. Branicky, Feb 16 2024

Formula

G.f.: Sum_{j>0} Sum_{i=1..j-1} x^(p(i)+p(j)), where p(k) is the k-th prime.
G.f.: A(x)^2/2 - A(x^2)/2 where A(x) = Sum_{p in primes} x^p. - Geoffrey Critzer, Nov 21 2012
a(n) = [x^n*y^2] Product_{i>=1} (1+x^prime(i)*y). - Alois P. Heinz, Nov 22 2012
a(n) = Sum_{i=2..floor((n-1)/2)} A010051(i) * A010051(n-i). - Wesley Ivan Hurt, Oct 29 2017

A080862 Numbers which can be expressed as the sum of two distinct primes in exactly six ways.

Original entry on oeis.org

60, 66, 72, 100, 110, 116, 172, 178, 182, 194, 206, 212, 218, 226, 248, 278, 326, 332, 398
Offset: 1

Views

Author

Shyam Sunder Gupta, Mar 29 2003

Keywords

Comments

Apparently there are no further terms beyond 398. - R. J. Mathar, Oct 01 2021

Examples

			66 is a term as 66 = 37 + 29 = 43 + 23 = 47 + 17 = 53 + 13 = 59 + 7 = 61 + 5 are only the six ways to express 66 as a sum of two distinct primes.
		

Crossrefs

Cf. A077914 (2 ways), A077969 (3 ways), A078299 (4 ways), A080854 (5 ways).

Programs

Formula

{j: A117929(j) = 6}. - R. J. Mathar, Oct 01 2021

A077969 Numbers which can be expressed as the sum of two distinct primes in exactly three ways.

Original entry on oeis.org

24, 30, 34, 40, 44, 46, 52, 56, 58, 98, 122, 128
Offset: 1

Views

Author

Shyam Sunder Gupta, Mar 29 2003

Keywords

Examples

			30 is a term as 30 = 23+7 = 19+11 = 17+13 are the only three ways to express 30 as a sum of three distinct primes.
		

Crossrefs

Cf. A077914 (2 ways), A078299 (4 ways), A080854 (5 ways), A080862 (6 ways).

A078299 Numbers which can be expressed as the sum of two distinct primes in exactly four ways.

Original entry on oeis.org

36, 42, 50, 74, 80, 82, 86, 88, 92, 94, 152, 158
Offset: 1

Views

Author

Shyam Sunder Gupta, Mar 29 2003

Keywords

Examples

			36 is a term as 36 = 31 + 5 = 29 + 7 = 23 + 13 = 19 + 17 are only the four ways to express 36 as a sum of two distinct primes.
		

Crossrefs

Cf. A077914 (2 ways), A077969 (3 ways), A080854 (5 ways), A080862 (6 ways).

A080854 Numbers which can be expressed as the sum of two distinct primes in exactly five ways.

Original entry on oeis.org

48, 54, 64, 70, 76, 104, 106, 118, 124, 134, 136, 146, 148, 164, 166, 188
Offset: 1

Views

Author

Shyam Sunder Gupta, Mar 29 2003

Keywords

Comments

Apparently there are no further terms beyond 188. - R. J. Mathar, Oct 01 2021

Examples

			54 is a term as 54 = 31 + 23 = 37 + 17 = 41 + 13 = 43 + 11 = 47 + 7 are only the five ways to express 54 as a sum of two distinct primes.
		

Crossrefs

Cf. A077914 (2 ways), A077969 (3 ways), A078299 (4 ways), A080862 (6 ways).

Programs

Formula

{j: A117929(j) = 5} . - R. J. Mathar, Oct 01 2021

A344989 Smallest number whose number of partitions into n distinct primes is n, or zero if there are no such partitions.

Original entry on oeis.org

2, 16, 26, 33, 55, 59, 0, 0, 124, 159, 233, 227, 276, 0, 372, 480, 0, 0, 0, 752, 0, 920, 0, 1011, 0, 1211, 1425, 0, 0, 0, 0, 0, 2050, 2336, 2495, 0, 0, 0, 0, 3340, 0, 3712, 0, 0, 4303, 0, 0, 0, 0, 5195, 0, 5669, 0, 6163, 6673, 0, 0, 0, 7504, 0, 0, 8670, 0, 9304, 9623, 0, 0, 0, 10638, 10981, 0, 12062, 0
Offset: 1

Views

Author

Metin Sariyar, Jun 04 2021

Keywords

Comments

From David A. Corneth, Aug 21 2025: (Start)
How to prove a 0? I used the heuristic:
a(n) = 0 if 2*n consecutive integers can be written in strictly more than n ways as a sum of n distinct primes and up to that point no positive integer has exactly n such ways.
What other rules where used? (End)

Examples

			a(2) = 16 because 16 is the smallest number whose number of partitions into 2 distinct primes is 2; 16 = 3+13 = 5+11.
		

Crossrefs

Cf. A364692 asks for the largest number with the same properties.

Extensions

a(12)-a(20) from Alois P. Heinz, Jun 04 2021
More terms from David A. Corneth, Aug 21 2025

A352305 a(n) is the (conjectured) largest even number that can be expressed as the sum of two distinct primes in exactly n ways.

Original entry on oeis.org

6, 38, 68, 128, 158, 188, 398, 362, 458, 542, 632, 692, 602, 992, 808, 908, 1112, 1238, 1412, 1418, 1718, 1544, 1574, 1622, 1682, 2048, 2252, 2018, 2672, 2042, 2558, 2936, 2504, 2978, 2966, 3092, 3218, 3242, 3272, 3506, 3632, 3754, 4022, 4058, 4052, 4412, 4448, 4478
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 11 2022

Keywords

Examples

			a(5) = 188 because 188 = 7 + 181 = 31 + 157 = 37 + 151 = 61 + 127 = 79 + 109 and it is conjectured that 188 is the last term of A080854.
		

Crossrefs

Extensions

More terms from Hugo Pfoertner, Dec 18 2024

A370090 Numbers that can be expressed in exactly one way as the unordered sum of two distinct primes.

Original entry on oeis.org

5, 7, 8, 9, 10, 12, 13, 14, 15, 19, 21, 25, 31, 33, 38, 39, 43, 45, 49, 55, 61, 63, 69, 73, 75, 81, 85, 91, 99, 103, 105, 109, 111, 115, 129, 133, 139, 141, 151, 153, 159, 165, 169, 175, 181, 183, 193, 195, 199, 201, 213, 225, 229, 231, 235, 241, 243, 253, 259, 265
Offset: 1

Views

Author

Wesley Ivan Hurt, Feb 11 2024

Keywords

Comments

Apparently, a number that is the predecessor or successor of a prime number does not have a sum as defined here, except for a finite number of primes, which may be {7, 11, 13, 37}. - Peter Luschny, Feb 16 2024

Examples

			5 = 2+3; 7 = 2+5; 8 = 3+5; 9 = 2+7; 10 = 3+7 (10 = 5+5 is not considered).
		

Crossrefs

Cf. A117929, A048974, A065091, A067187 (not necessarily distinct).
If we change 1 way (this sequence) we get A077914 (2 ways), A077969 (3 ways), A078299 (4 ways), A080854 (5 ways), and A080862 (6 ways).

Programs

  • Maple
    select(n -> A117929(n) = 1, [seq(1..265)]);  # Peter Luschny, Feb 16 2024
  • Mathematica
    tdpQ[{a_,b_}]:=AllTrue[{a,b},PrimeQ]&&a!=b; Select[Range[300],Count[IntegerPartitions[#,{2}],?tdpQ]==1&] (* _Harvey P. Dale, Dec 30 2024 *)
  • Python
    from sympy import sieve
    from collections import Counter
    from itertools import combinations
    def aupton(max):
        sieve.extend(max)
        a = Counter(c[0]+c[1] for c in combinations(sieve._list, 2))
        return [n for n in range(1, max+1) if a[n] == 1]
    print(aupton(265)) # Michael S. Branicky, Feb 16 2024

A140955 Even integers that do not have at least two partitions into 2 distinct primes.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 38
Offset: 1

Views

Author

Gil Broussard, Jul 25 2008

Keywords

Comments

If A056636(3) = 128 (as is conjectured), then 38 is the last term in the sequence. - Charles R Greathouse IV, Sep 07 2022

Examples

			8 is a term because 3+5 is the only sum of primes = 8.
16 is not in the sequence because 16 = 3+13 and 5+11.
The only ways to express 10 as a sum of two unordered primes are 3+7 and 5+5. In one of the sums the primes are distinct. Thus, 10 is in this sequence. - _Tanya Khovanova_, Sep 07 2022
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,100,2],Length[Select[Union/@IntegerPartitions[#,{2}],AllTrue[#,PrimeQ]&&Length[#]==2&]]<2&] (* James C. McMahon, Jul 15 2025 *)
  • PARI
    is(n)=if(n%2, return(0)); my(t); forprime(p=3, n\2-1, if(isprime(n-p) && t++>1, return(0))); 1 \\ Charles R Greathouse IV, Sep 07 2022

Extensions

Offset changed to 1 by Alois P. Heinz, Sep 07 2022

A352596 Conjecturally the number of positive even integers that can be expressed as the sum of two distinct primes in exactly n ways.

Original entry on oeis.org

3, 5, 9, 12, 12, 16, 19, 13, 24, 19, 21, 25, 15, 29, 28, 16, 31, 22, 34, 32, 20, 29, 26, 24, 28, 36, 34, 35, 37, 22, 29, 37, 36, 34, 39, 32, 39, 35, 28, 31, 28
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 22 2022

Keywords

Crossrefs

Showing 1-10 of 10 results.