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

A219180 Number T(n,k) of partitions of n into k distinct prime parts; triangle T(n,k), n>=0, read by rows.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Nov 13 2012

Keywords

Comments

T(n,k) is defined for all n>=0 and k>=0. The triangle contains only elements with 0 <= k <= A024936(n). T(n,k) = 0 for k > A024936(n). Three rows are empty because there are no partitions of n into distinct prime parts for n in {1,4,6}.

Examples

			T(0,0) = 1: [], the empty partition.
T(2,1) = 1: [2].
T(5,1) = 1: [5], T(5,2) = 1: [2,3].
T(16,2) = 2: [5,11], [3,13].
Triangle T(n,k) begins:
  1;
  ;
  0, 1;
  0, 1;
  ;
  0, 1, 1;
  ;
  0, 1, 1;
  0, 0, 1;
  0, 0, 1;
  0, 0, 1, 1;
  0, 1;
  0, 0, 1, 1;
  ...
		

Crossrefs

Row lengths are 1 + A024936(n).
Row sums give: A000586.
Last elements of rows give: A219181.
Row maxima give: A219182.
Least n with T(n,k) > 0 is A007504(k).

Programs

  • Maple
    b:= proc(n, i) option remember;
          `if`(n=0, [1], `if`(i<1, [], zip((x, y)->x+y, b(n, i-1),
           [0, `if`(ithprime(i)>n, [], b(n-ithprime(i), i-1))[]], 0)))
        end:
    T:= proc(n) local l; l:= b(n, numtheory[pi](n));
           while nops(l)>0 and l[-1]=0 do l:= subsop(-1=NULL, l) od; l[]
        end:
    seq(T(n), n=0..50);
  • Mathematica
    nn=20;a=Table[Prime[n],{n,1,nn}];CoefficientList[Series[Product[1+y x^a[[i]],{i,1,nn}],{x,0,nn}],{x,y}]//Grid  (* Geoffrey Critzer, Nov 21 2012 *)
    zip[f_, x_List, y_List, z_] := With[{m = Max[Length[x], Length[y]]}, f[PadRight[x, m, z], PadRight[y, m, z]]]; b[n_, i_] := b[n, i] = If[n == 0, {1}, If[i<1, {}, zip[Plus, b[n, i-1], Join[{0}, If[Prime[i] > n, {}, b[n-Prime[i], i-1]]], 0]]]; T[n_] := Module[{l}, l = b[n, PrimePi[n]]; While[Length[l]>0 && l[[-1]] == 0, l = ReplacePart[l, -1 -> Sequence[]]]; l]; Table[T[n], {n, 0, 50}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)
  • PARI
    T(n)={ Vec(prod(k=1, n, 1 + isprime(k)*y*x^k + O(x*x^n))) }
    { my(t=T(20)); for(n=1, #t, print(if(t[n]!=0, Vecrev(t[n]), []))) } \\ Andrew Howroyd, Dec 22 2017

Formula

G.f. of column k: Sum_{0
T(n,k) = [x^n*y^k] Product_{i>=1} (1+x^prime(i)*y).

A061357 Number of 0

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 3, 2, 3, 4, 1, 3, 4, 3, 3, 5, 4, 3, 5, 3, 3, 6, 2, 5, 6, 2, 5, 6, 4, 5, 7, 4, 4, 8, 4, 4, 9, 4, 4, 7, 3, 6, 8, 5, 5, 8, 6, 7, 10, 6, 5, 12, 3, 5, 10, 3, 7, 9, 5, 5, 8, 7, 7, 11, 5, 5, 12, 4, 8, 11, 4, 8, 10, 5, 5, 13, 9, 6, 11, 7, 6, 14, 6, 8, 13, 5, 8, 11, 6, 9
Offset: 1

Author

Amarnath Murthy, Apr 28 2001

Keywords

Comments

Number of prime pairs (p,q) with p < n < q and q-n = n-p.
The same as the number of ways n can be expressed as the mean of two distinct primes.
Conjecture: for n>=4 a(n)>0. - Benoit Cloitre, Apr 29 2003
Conjectures from Rick L. Shepherd, Jun 24 2003: (Start)
1) For each integer N>=1 there exists a positive integer m(N) such that for n>=m(N) a(n)>a(N). (After the first m(N)-1 terms, a(N) does not reappear). In particular, for N=1 (or 2 or 3), m(N)=4 and a(N)=0, giving Benoit Cloitre's conjecture. (cont.)
(cont.) Conjectures based upon observing a(1),...,a(10000):
m(4)=m(5)=m(6)=m(7)=m(19)=20 for a(4)=a(5)=a(6)=a(7)=a(19)=1,
m(8)=...(7 others)...=m(34)=35 for a(8)=...(7 others)...=a(34)=2,
m(12)=...(10 others)...=m(64)=65 for a(12)=...(10 others)...=a(64)=3,
m(18)=...(10 others)...=m(79)=80 for a(18)=...(10 others)...=a(79)=4,
m(24)=...(14 others)...=m(94)=95 for a(24)=...(14 others)...=a(94)=5,
m(30)=...(17 others)...=m(199)=200 for a(30)=...(17 others)...=a(199)=6, etc.
2) Each nonnegative integer appears at least once in the current sequence.
3) Stronger than 2): A001477 (nonnegative integers) is a subsequence of the current sequence. (Supporting evidence: I've observed that 0,1,2,...,175 is a subsequence of a(1),...,a(10000)).
(End)
a(n) is also the number of k such that 2*k+1=p and 2*(n-k-1)+1=q are both odd primes with p < q with p*q = n^2 - m^2. [Pierre CAMI, Sep 01 2008]
Also: Number of ways n^2 can be written as b^2+pq where 0
a(n) = sum (A010051(2*n - p): p prime < n). [Reinhard Zumkeller, Oct 19 2011]
a(n) is also the number of partitions of 2*n into two distinct primes. See the first formula by T. D. Noe, and the Alois P. Heinz, Nov 14 2012, crossreference. - Wolfdieter Lang, May 13 2016
All 0Jamie Morken, Jun 02 2017
a(n) is the number of appearances of n in A143836. - Ya-Ping Lu, Mar 05 2023

Examples

			a(10)= 2: there are two such pairs (3,17) and (7,13), as 10 = (3+17)/2 = (7+13)/2.
		

Crossrefs

Cf. A071681 (subsequence for prime n only).
Cf. A092953.
Bisection of A117929 (even part). - Alois P. Heinz, Nov 14 2012

Programs

  • Haskell
    a061357 n = sum $
       zipWith (\u v -> a010051 u * a010051 v) [n+1..] $ reverse [1..n-1]
    -- Reinhard Zumkeller, Nov 10 2012, Oct 19 2011
    
  • Mathematica
    Table[Count[Range[n - 1], k_ /; And[PrimeQ[n - k], PrimeQ[n + k]]], {n, 98}] (* Michael De Vlieger, May 14 2016 *)
  • PARI
    a(n)=my(s);forprime(p=2,n-1,s+=isprime(2*n-p));s \\ Charles R Greathouse IV, Mar 08 2013
    
  • Python
    from sympy import primerange, isprime
    def A061357(n): return sum(1 for p in primerange(n) if isprime((n<<1)-p)) # Chai Wah Wu, Sep 03 2024

Formula

a(n) = A045917(n) - A010051(n). - T. D. Noe, May 08 2007
a(n) = sum(A010051(n-k)*A010051(n+k): 1 <= k < n). - Reinhard Zumkeller, Nov 10 2012
a(n) = sum_{i=2..n-1} A010051(i)*A010051(2n-i). [Wesley Ivan Hurt, Aug 18 2013]

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001

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

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).

A166081 Natural numbers that are not the sum of two distinct primes.

Original entry on oeis.org

1, 2, 3, 4, 6, 11, 17, 23, 27, 29, 35, 37, 41, 47, 51, 53, 57, 59, 65, 67, 71, 77, 79, 83, 87, 89, 93, 95, 97, 101, 107, 113, 117, 119, 121, 123, 125, 127, 131, 135, 137, 143, 145, 147, 149, 155, 157, 161, 163, 167, 171, 173, 177, 179, 185, 187, 189, 191, 197, 203
Offset: 1

Author

Juri-Stepan Gerasimov, Oct 06 2009

Keywords

Comments

All numbers that appear in A014092 are also in this sequence, by definition.
It seems that, for n > 6, the reverse is also true, however this is unproved. - Ely Golden, Dec 25 2016
All numbers that appear in this sequence but not A014092 must be even semiprimes with no other partitions into primes. - Ely Golden, Dec 25 2016

Crossrefs

Cf. A117929, A006881, A038609 (complement), A014092, A066615.

Programs

  • Mathematica
    Select[Range@ 204, Length@Select[Transpose@{#, Reverse@ # - 1} &@ Range[#] &@ #, Times @@ Boole@ Map[PrimeQ, #] == 1 && First@ # != Last@ # &] == 0 &] (* Michael De Vlieger, Apr 24 2016 *)
    max = 1000;
    ip = PrimePi[max];
    A038609 = Table[Prime[i] + Prime[j], {i, ip}, {j, i + 1, ip}] // Flatten // Union // Select[#, # <= max&]&;
    Complement[Range[max], A038609] (* Jean-François Alcover, Mar 24 2020 *)

Formula

{1} U A025584 U A109934. - R. J. Mathar, Oct 08 2009
A000027 \ A038609. - R. J. Mathar, Oct 14 2009

A341973 Number of partitions of n into 2 distinct primes (counting 1 as a prime).

Original entry on oeis.org

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

Author

Ilya Gutkovskiy, Feb 24 2021

Keywords

Programs

  • Maple
    b:= proc(n, i) option remember; series(`if`(n=0, 1,
         `if`(i<0, 0, (p-> `if`(p>n, 0, x*b(n-p, i-1)))(
         `if`(i=0, 1, ithprime(i)))+b(n, i-1))), x, 3)
        end:
    a:= n-> coeff(b(n, numtheory[pi](n)), x, 2):
    seq(a(n), n=3..96);  # Alois P. Heinz, Feb 24 2021
  • Mathematica
    a[n_] := Select[IntegerPartitions[n, {2}, Join[{1},
        Prime[Range[PrimePi[n-1]]]]], #[[1]] != #[[2]]&] // Length;
    a /@ Range[3, 100] (* Jean-François Alcover, Jul 13 2021 *)

Formula

a(n) = A117929(n) + A010051(n-1). - R. J. Mathar, Oct 01 2021

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

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

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

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

A087747 Least number expressible as a sum of two distinct primes in exactly n ways.

Original entry on oeis.org

5, 16, 24, 36, 48, 60, 78, 84, 90, 114, 144, 120, 168, 180, 234, 246, 288, 240, 210, 324, 300, 360, 474, 330, 528, 576, 390, 462, 480, 420, 570, 510, 672, 792, 756, 876, 714, 798, 690, 1038, 630, 1008, 930, 780, 960, 870, 924, 900, 1134, 1434, 840, 990, 1302, 1080, 1230, 1518
Offset: 1

Author

Lekraj Beedassy, Oct 02 2003

Keywords

Examples

			a(2)=16 because we have 16=3+13=5+11, followed by 18=5+13=7+11; 20=3+17=7+13; 22=3+19=5+17; 26=3+23=7+19;...
		

Crossrefs

Cf. A117929.

Programs

  • Mathematica
    Module[{nn=2000,ip},ip=Table[{n,Length[Select[IntegerPartitions[n,{2}], #[[1]]!=#[[2]]&&AllTrue[#,PrimeQ]&]]},{n,nn}];Table[SelectFirst[ip, #[[2]]==k&],{k,60}]][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 11 2020 *)

Formula

a(n) = min({m >= 1 : A117929(m) = n}). - Peter Munn, May 01 2023

Extensions

More terms from John Dethridge (jcd(AT)ms.unimelb.edu.au), Jan 08 2004
More terms from Hugo Pfoertner, Sep 23 2004
Reinserted a(18), a(19) and a(20) by Paolo P. Lava, May 26 2014

A243485 Sum of all the products formed by multiplying the corresponding smaller and larger parts of the Goldbach partitions of n.

Original entry on oeis.org

0, 0, 0, 4, 6, 9, 10, 15, 14, 46, 0, 35, 22, 82, 26, 94, 0, 142, 34, 142, 38, 263, 0, 357, 46, 371, 0, 302, 0, 591, 58, 334, 62, 780, 0, 980, 0, 578, 74, 821, 0, 1340, 82, 785, 86, 1356, 0, 1987, 94, 1512, 0, 1353, 0, 2677, 106, 1421, 0, 2320, 0, 4242, 118
Offset: 1

Author

Wesley Ivan Hurt, Jun 05 2014

Keywords

Comments

a(n) is even for odd n.
If Goldbach's conjecture is true, a(n) > 0 for all even n > 2.
Sum of the areas of the distinct rectangles with prime length and width such that L + W = n, W <= L. For example, a(16) = 94; the two rectangles are 3 X 13 and 5 X 11, and the sum of their areas is 3*13 + 5*11 = 94. - Wesley Ivan Hurt, Oct 28 2017

Crossrefs

Programs

  • Maple
    with(numtheory): A243485:=n->add(i*(n-i)*(pi(i)-pi(i-1))*(pi(n-i)-pi(n-i-1)), i=1..floor(n/2)): seq(A243485(n), n=1..100); # Wesley Ivan Hurt, Oct 29 2017
  • Mathematica
    Table[Sum[i*(n - i)*Floor[2/PrimeOmega[i (n - i)]], {i, 2, n/2}], {n,
      50}]

Formula

a(n) = Sum_{i=2..n/2} i*(n-i) * A064911(i*(n-i)).
a(n) = Sum_{i=1..floor(n/2)} i * (n-i) * A010051(i) * A010051(n-i). - Wesley Ivan Hurt, Oct 29 2017

A347550 Number of partitions of n into at most 2 distinct prime parts.

Original entry on oeis.org

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

Author

Ilya Gutkovskiy, Sep 08 2021

Keywords

Crossrefs

Formula

a(n) = Sum_{k=0..2} A219180(n,k). - Alois P. Heinz, Sep 08 2021
Showing 1-10 of 18 results. Next