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-8 of 8 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

A077914 Sums of two distinct primes in exactly two ways.

Original entry on oeis.org

16, 18, 20, 22, 26, 28, 32, 62, 68
Offset: 1

Views

Author

Shyam Sunder Gupta, Mar 29 2003

Keywords

Comments

Most likely no more terms. See A117929. - T. D. Noe, Mar 21 2012
Numbers k such that A117929(k) = 2. - Joerg Arndt, Jun 07 2021

Examples

			22 is a term as 22 = 19+3 = 17+5 are the only two ways to express 22 as a sum of two distinct primes.
		

Crossrefs

Cf. A077969 (3 ways), A078299 (4 ways), A080854 (5 ways), A080862 (6 ways).

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

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

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