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

A316154 Number of integer partitions of prime(n) into a prime number of prime parts.

Original entry on oeis.org

0, 0, 1, 2, 3, 5, 9, 12, 19, 39, 50, 93, 136, 166, 239, 409, 682, 814, 1314, 1774, 2081, 3231, 4272, 6475, 11077, 14270, 16265, 20810, 23621, 30031, 68251, 85326, 118917, 132815, 226097, 251301, 342448, 463940, 565844, 759873, 1015302, 1117708, 1787452, 1961624
Offset: 1

Views

Author

Gus Wiseman, Jun 25 2018

Keywords

Examples

			The a(7) = 9 partitions of 17 into a prime number of prime parts: (13,2,2), (11,3,3), (7,7,3), (7,5,5), (7,3,3,2,2), (5,5,3,2,2), (5,3,3,3,3), (5,2,2,2,2,2,2), (3,3,3,2,2,2,2).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, p, c) option remember; `if`(n=0 or p=2,
          `if`(n::even and isprime(c+n/2), 1, 0),
          `if`(p>n, 0, b(n-p, p, c+1))+b(n, prevprime(p), c))
        end:
    a:= n-> b(ithprime(n)$2, 0):
    seq(a(n), n=1..50);  # Alois P. Heinz, Jun 26 2018
  • Mathematica
    Table[Length[Select[IntegerPartitions[Prime[n]],And[PrimeQ[Length[#]],And@@PrimeQ/@#]&]],{n,20}]
    (* Second program: *)
    b[n_, p_, c_] := b[n, p, c] = If[n == 0 || p == 2, If[EvenQ[n] && PrimeQ[c + n/2], 1, 0], If[p>n, 0, b[n - p, p, c + 1]] + b[n, NextPrime[p, -1], c]];
    a[n_] := b[Prime[n], Prime[n], 0];
    Array[a, 50] (* Jean-François Alcover, May 20 2021, after Alois P. Heinz *)
  • PARI
    seq(n)={my(p=vector(n,k,prime(k))); my(v=Vec(1/prod(k=1, n, 1 - x^p[k]*y + O(x*x^p[n])))); vector(n, k, sum(i=1, k, polcoeff(v[1+p[k]], p[i])))} \\ Andrew Howroyd, Jun 26 2018

Formula

a(n) = A085755(A000040(n)). - Alois P. Heinz, Jun 26 2018

Extensions

Terms a(21) and beyond from Andrew Howroyd, Jun 26 2018

A316185 Number of strict integer partitions of the n-th prime into a prime number of prime parts.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 0, 2, 2, 3, 5, 5, 6, 8, 10, 13, 18, 20, 26, 32, 34, 45, 54, 66, 90, 106, 117, 135, 142, 165, 269, 311, 375, 398, 546, 579, 689, 823, 938, 1107, 1301, 1352, 1790, 1850, 2078, 2153, 2878, 3811, 4241, 4338, 4828, 5495, 5637, 7076, 8000, 9032
Offset: 1

Views

Author

Gus Wiseman, Jun 25 2018

Keywords

Examples

			The a(14) = 8 partitions of 43 into a prime number of distinct prime parts: (41,2), (31,7,5), (29,11,3), (23,17,3), (23,13,7), (19,17,7), (19,13,11), (17,11,7,5,3).
		

Crossrefs

Programs

  • Maple
    h:= proc(n) option remember; `if`(n=0, 0,
         `if`(isprime(n), n, h(n-1)))
        end:
    b:= proc(n, i, c) option remember; `if`(n=0,
          `if`(isprime(c), 1, 0), `if`(i<2, 0, b(n, h(i-1), c)+
          `if`(i>n, 0, b(n-i, h(min(n-i, i-1)), c+1))))
        end:
    a:= n-> b(ithprime(n)$2, 0):
    seq(a(n), n=1..56);  # Alois P. Heinz, May 26 2021
  • Mathematica
    Table[Length[Select[IntegerPartitions[Prime[n]],And[UnsameQ@@#,PrimeQ[Length[#]],And@@PrimeQ/@#]&]],{n,10}]
    (* Second program: *)
    h[n_] := h[n] = If[n == 0, 0, If[PrimeQ[n], n, h[n - 1]]];
    b[n_, i_, c_] := b[n, i, c] = If[n == 0,
         If[PrimeQ[c], 1, 0], If[i < 2, 0, b[n, h[i - 1], c] +
         If[i > n, 0, b[n - i, h[Min[n - i, i - 1]], c + 1]]]];
    a[n_] := b[Prime[n], Prime[n], 0];
    Array[a, 56] (* Jean-François Alcover, Jun 11 2021, after Alois P. Heinz *)
  • PARI
    seq(n)={my(p=vector(n, k, prime(k))); my(v=Vec(prod(k=1, n, 1 + x^p[k]*y + O(x*x^p[n])))); vector(n, k, sum(i=1, k, polcoeff(v[1+p[k]], p[i])))} \\ Andrew Howroyd, Jun 26 2018

Formula

a(n) = A045450(A000040(n)).

Extensions

More terms from Alois P. Heinz, Jun 26 2018

A344677 Number of partitions of n containing a prime number of primes and an arbitrary number of nonprimes.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 4, 6, 9, 13, 20, 26, 36, 49, 68, 90, 120, 154, 201, 258, 330, 418, 532, 666, 834, 1041, 1290, 1592, 1958, 2404, 2935, 3588, 4345, 5278, 6366, 7692, 9215, 11096, 13230, 15853, 18831, 22477, 26580, 31620, 37247, 44145, 51851, 61247, 71681, 84445
Offset: 0

Views

Author

Paolo Xausa, May 26 2021

Keywords

Examples

			a(6) = 4 because there are 4 partitions of 6 that contain a prime number of primes (including repetitions). These partitions are [3,3], [3,2,1], [2,2,2], [2,2,1,1].
		

Crossrefs

Programs

  • Mathematica
    nterms=50;Table[Total[Map[If[PrimeQ[Count[#, _?PrimeQ]],1,0] &,IntegerPartitions[n]]],{n,0,nterms-1}]
    (* Second program: *)
    seq[n_] := Module[{p}, p = 1/Product[1 - If[PrimeQ[k], y*x^k, 0] + O[x]^n, {k, 2, n}]; CoefficientList[Sum[If[PrimeQ[k], Coefficient[p, y, k], 0], {k, 2, n}]/QPochhammer[x + O[x]^n]/(p /. y -> 1), x]];
    seq[50] (* Jean-François Alcover, May 27 2021, after Andrew Howroyd *)
  • PARI
    seq(n)={my(p=1/prod(k=2, n, 1 - if(isprime(k), y*x^k) + O(x*x^n))); Vec(sum(k=2, n, if(isprime(k), polcoef(p,k,y)))/eta(x+O(x*x^n))/subst(p,y,1), -(n+1))} \\ Andrew Howroyd, May 26 2021

A316153 Heinz numbers of integer partitions of prime numbers into a prime number of prime parts.

Original entry on oeis.org

15, 33, 45, 93, 153, 177, 275, 327, 369, 405, 425, 537, 603, 605, 775, 831, 891, 1025, 1059, 1125, 1413, 1445, 1475, 1641, 1705, 1719, 1761, 2057, 2075, 2319, 2511, 2577, 2979, 3175, 3179, 3189, 3459, 3485, 3603, 3609, 3825, 3925, 4299, 4475, 4497, 4565, 4581
Offset: 1

Views

Author

Gus Wiseman, Jun 25 2018

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			Sequence of integer partitions of prime numbers into a prime number of prime parts, preceded by their Heinz numbers, begins:
   15: (3,2)
   33: (5,2)
   45: (3,2,2)
   93: (11,2)
  153: (7,2,2)
  177: (17,2)
  275: (5,3,3)
  327: (29,2)
  369: (13,2,2)
  405: (3,2,2,2,2)
  425: (7,3,3)
  537: (41,2)
  603: (19,2,2)
  605: (5,5,3)
  775: (11,3,3)
  831: (59,2)
  891: (5,2,2,2,2)
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[1000],And[PrimeQ[PrimeOmega[#]],PrimeQ[Total[primeMS[#]]],And@@PrimeQ/@primeMS[#]]&]

A339445 Number of partitions of n into squares such that the number of parts is a square.

Original entry on oeis.org

1, 1, 0, 0, 2, 0, 0, 1, 0, 2, 1, 0, 2, 1, 0, 2, 3, 1, 2, 2, 2, 2, 2, 2, 3, 5, 2, 4, 6, 1, 4, 6, 3, 7, 6, 4, 10, 6, 4, 10, 9, 6, 11, 10, 8, 10, 10, 11, 14, 16, 11, 15, 19, 10, 17, 22, 13, 24, 23, 16, 28, 21, 18, 33, 30, 24, 33, 33, 29, 33, 37, 33, 43, 45, 35, 49
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 05 2020

Keywords

Examples

			                                    [1 1 1]
                          [1 4]     [1 1 1]
a(23) = 2 because we have [9 9] and [4 4 9].
		

Crossrefs

Programs

  • Maple
    g:= proc(n, k, m)
      # number of partitions of n into k parts which are squares > m^2
       option remember; local r;
      if k = 0 then if n = 0 then return 1 else return 0 fi fi;
      if n < k*(m+1)^2 then return 0 fi;
      add(procname(n-r*(m+1)^2, k-r, m+1), r =max(0, ceil((k*(m+2)^2-n)/(2*m+3))) .. k)
    end proc:
    f:= proc(n) local k; add(g(n,k^2,0),k=1..floor(sqrt(n))) end proc:
    f(0):= 1:
    map(f, [$0..100]); # Robert Israel, Oct 26 2023

A316151 Heinz numbers of strict integer partitions of prime numbers into prime parts.

Original entry on oeis.org

3, 5, 11, 15, 17, 31, 33, 41, 59, 67, 83, 93, 109, 127, 157, 177, 179, 191, 211, 241, 277, 283, 327, 331, 353, 367, 401, 431, 461, 509, 537, 547, 563, 587, 599, 617, 709, 739, 773, 797, 831, 859, 877, 919, 967, 991, 1031, 1059, 1063, 1087, 1153, 1171, 1201
Offset: 1

Views

Author

Gus Wiseman, Jun 25 2018

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			Sequence of strict integer partitions of prime numbers into prime parts, preceded by their Heinz numbers, begins:
   3: (2)
   5: (3)
  11: (5)
  15: (3,2)
  17: (7)
  31: (11)
  33: (5,2)
  41: (13)
  59: (17)
  67: (19)
  83: (23)
  93: (11,2)
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],And[SquareFreeQ[#],PrimeQ[Total[primeMS[#]]],And@@PrimeQ/@primeMS[#]]&]

A339434 Number of compositions (ordered partitions) of n into a prime number of distinct prime parts.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 8, 0, 8, 2, 8, 8, 10, 0, 16, 8, 16, 14, 16, 12, 18, 14, 22, 18, 136, 18, 138, 26, 22, 26, 258, 30, 266, 30, 266, 158, 492, 36, 506, 158, 510, 278, 744, 174, 748, 290, 758, 528, 990, 306, 1228, 668, 1116, 780, 6384, 678, 6630, 800, 1720, 1274
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 04 2020

Keywords

Examples

			a(10) = 8 because we have [7, 3], [3, 7], [5, 3, 2], [5, 2, 3], [3, 5, 2], [3, 2, 5], [2, 5, 3] and [2, 3, 5].
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n<1, 0, ithprime(n)+s(n-1)) end:
    b:= proc(n, i, t) option remember; `if`(s(i)`if`(p>n, 0,
             b(n-p, i-1, t+1)))(ithprime(i))+b(n, i-1, t)))
        end:
    a:= n-> b(n, numtheory[pi](n), 0):
    seq(a(n), n=0..70);  # Alois P. Heinz, Dec 04 2020
  • Mathematica
    s[n_] := s[n] = If[n < 1, 0, Prime[n] + s[n - 1]];
    b[n_, i_, t_] := b[n, i, t] = If[s[i] < n, 0,
         If[n == 0, If[PrimeQ[t], t!, 0], Function[p, If[p > n, 0,
           b[n - p, i - 1, t + 1]]][Prime[i]] + b[n, i - 1, t]]];
    a[n_] := b[n, PrimePi[n], 0];
    Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Mar 01 2022, after Alois P. Heinz *)

A339444 Number of partitions of n into triangular numbers such that the number of parts is a triangular number.

Original entry on oeis.org

1, 1, 0, 2, 0, 1, 2, 1, 2, 1, 4, 1, 4, 2, 3, 6, 4, 6, 4, 7, 6, 10, 8, 8, 11, 11, 14, 11, 17, 14, 22, 19, 18, 24, 24, 30, 27, 33, 31, 38, 42, 39, 47, 49, 54, 59, 60, 63, 72, 77, 79, 85, 95, 94, 104, 116, 115, 131, 133, 142, 154, 165, 168, 180, 200, 203
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 05 2020

Keywords

Examples

			                          [1]
                          [1 1]      [1]
                          [1 1 1]    [1 1]    [1]
a(10) = 4 because we have [1 1 1 1], [1 3 3], [3 6] and [10].
		

Crossrefs

A344715 Number of partitions of n containing a prime number of distinct primes and an arbitrary number of nonprimes.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 3, 5, 9, 12, 20, 27, 42, 56, 80, 107, 151, 195, 265, 342, 453, 577, 753, 949, 1220, 1525, 1930, 2398, 3006, 3701, 4594, 5625, 6922, 8426, 10291, 12455, 15117, 18203, 21955, 26326, 31576, 37689, 45002, 53498, 63581, 75313, 89125, 105199, 124056
Offset: 0

Views

Author

Paolo Xausa, May 27 2021

Keywords

Examples

			a(10) = 12 because there are 12 partitions of 10 that contain a prime number of primes (not counting repetitions). These partitions are [7,3] (containing 2 primes), [7,2,1] (containing 2 primes), [5,3,2] (containing 3 primes), [5,3,1,1] (containing 2 primes), [5,2,2,1] (containing 2 distinct primes), [5,2,1,1,1] (containing 2 primes), [4,3,2,1] (containing 2 primes), [3,3,2,2] (containing 2 distinct primes), [3,3,2,1,1] (containing 2 distinct primes), [3,2,2,2,1] (containing 2 distinct primes), [3,2,2,1,1,1] (containing 2 distinct primes) and [3,2,1,1,1,1,1] (containing 2 primes).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; expand(
          `if`(n=0 or i=1, 1, b(n, i-1)+`if`(isprime(i), x, 1)
              *add(b(n-i*j, i-1), j=1..n/i)))
        end:
    a:= n-> (p-> add(`if`(isprime(i), coeff(p, x, i), 0),
                 i=2..degree(p)))(b(n$2)):
    seq(a(n), n=0..49);  # Alois P. Heinz, Nov 14 2021
  • Mathematica
    nterms=50;Table[Total[Map[If[PrimeQ[Count[#, _?PrimeQ]],1,0] &,Map[DeleteDuplicates[#]&,IntegerPartitions[n],{1}]]],{n,0,nterms-1}]
  • PARI
    seq(n)={my(p=prod(k=2, n, 1 - y + y/(1 - if(isprime(k), x^k))  + O(x*x^n) ) ); Vec(sum(k=2, n, if(isprime(k), polcoef(p,k,y)))/eta(x+O(x*x^n))/subst(p, y, 1), -(n+1))} \\ Andrew Howroyd, May 27 2021

A344890 Number of partitions of prime(n) containing a prime number of distinct primes and an arbitrary number of nonprimes.

Original entry on oeis.org

0, 0, 1, 3, 20, 42, 151, 265, 753, 3006, 4594, 15117, 31576, 45002, 89125, 235501, 589613, 792426, 1871442, 3251293, 4261819, 9403682, 15690192, 33111688, 86520382, 137957345, 173655404, 273492399, 342231447, 532915031, 2380864800, 3601147053, 6628703864
Offset: 1

Views

Author

Paolo Xausa, Jun 01 2021

Keywords

Examples

			a(4) = 3 because there are 3 partitions of prime(4)=7 that contain a prime number of primes (not counting repetitions). These partitions are [5,2] (containing 2 primes), [3,2,2] (containing 2 unique primes) and [3,2,1,1] (containing 2 primes).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; expand(
          `if`(n=0 or i=1, 1, b(n, i-1)+`if`(isprime(i), x, 1)
              *add(b(n-i*j, i-1), j=1..n/i)))
        end:
    a:= n-> (p-> add(`if`(isprime(i), coeff(p, x, i), 0),
                 i=2..degree(p)))(b(ithprime(n)$2)):
    seq(a(n), n=1..33);  # Alois P. Heinz, Nov 14 2021
  • Mathematica
    nterms=22;Table[Total[Map[If[PrimeQ[Count[#, _?PrimeQ]],1,0] &,Map[DeleteDuplicates[#]&,IntegerPartitions[Prime[n]],{1}]]],{n,1,nterms}]

Formula

a(n) = A344715(A000040(n)).

Extensions

a(23)-a(33) from Alois P. Heinz, Jun 02 2021
Showing 1-10 of 11 results. Next