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

A002095 Number of partitions of n into nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 3, 5, 6, 8, 8, 12, 13, 17, 19, 26, 28, 37, 40, 52, 58, 73, 79, 102, 113, 139, 154, 191, 210, 258, 284, 345, 384, 462, 509, 614, 679, 805, 893, 1060, 1171, 1382, 1528, 1792, 1988, 2319, 2560, 2986, 3304, 3823, 4231, 4888, 5399, 6219, 6870
Offset: 0

Views

Author

Keywords

Comments

Partial sums of A023895. - Emeric Deutsch, Apr 19 2006
Column k=0 of A222656. - Alois P. Heinz, May 29 2013

Examples

			a(6) = 3 from the partitions 6 = 1+1+1+1+1+1 = 4+1+1.
		

References

  • L. M. Chawla and S. A. Shad, On a trio-set of partition functions and their tables, J. Natural Sciences and Mathematics, 9 (1969), 87-96.
  • A. Murthy, Some new Smarandache sequences, functions and partitions, Smarandache Notions Journal Vol. 11 N. 1-2-3 Spring 2000 (but beware errors).
  • Amarnath Murthy and Charles Ashbacher, Generalized Partitions and Some New Ideas on Number Theory and Smarandache Sequences, Hexis, Phoenix; USA 2005. See Section 2.6.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a002095 = p a018252_list where
       p _          0 = 1
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Jan 15 2012
    
  • Maple
    g:=product((1-x^ithprime(j))/(1-x^j),j=1..60): gser:=series(g,x=0,60): seq(coeff(gser,x,n),n=0..55); # Emeric Deutsch, Apr 19 2006
  • Mathematica
    NonPrime[n_Integer] := FixedPoint[n + PrimePi[ # ] &, n + PrimePi[n]]; CoefficientList[ Series[1/Product[1 - x^NonPrime[i], {i, 1, 50}], {x, 0, 50}], x]
  • PARI
    first(n)=my(x='x+O('x^(n+1)),pr=1); forprime(p=2,n+1, pr *= (1-x^p)); pr/prod(i=1,n+1, 1-x^i) \\ Charles R Greathouse IV, Jun 23 2017

Formula

G.f.: Product_{i>0} (1-x^prime(i))/(1-x^i). - Vladeta Jovovic, Jul 31 2004

Extensions

More terms from James Sellers, Dec 23 1999
Corrected by Robert G. Wilson v, Feb 11 2002

A037032 Total number of prime parts in all partitions of n.

Original entry on oeis.org

0, 1, 2, 4, 7, 13, 20, 32, 48, 73, 105, 153, 214, 302, 415, 569, 767, 1034, 1371, 1817, 2380, 3110, 4025, 5199, 6659, 8512, 10806, 13684, 17229, 21645, 27049, 33728, 41872, 51863, 63988, 78779, 96645, 118322, 144406, 175884, 213617, 258957, 313094, 377867
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the sum of the differences between the sum of p-th largest and the sum of (p+1)st largest elements in all partitions of n for all primes p. - Omar E. Pol, Oct 25 2012

Examples

			From _Omar E. Pol_, Nov 20 2011 (Start):
For n = 6 we have:
--------------------------------------
.                        Number of
Partitions              prime parts
--------------------------------------
6 .......................... 0
3 + 3 ...................... 2
4 + 2 ...................... 1
2 + 2 + 2 .................. 3
5 + 1 ...................... 1
3 + 2 + 1 .................. 2
4 + 1 + 1 .................. 0
2 + 2 + 1 + 1 .............. 2
3 + 1 + 1 + 1 .............. 1
2 + 1 + 1 + 1 + 1 .......... 1
1 + 1 + 1 + 1 + 1 + 1 ...... 0
------------------------------------
Total ..................... 13
So a(6) = 13.
(End)
		

Crossrefs

Programs

  • Maple
    with(combinat): a:=proc(n) local P,c,j,i: P:=partition(n): c:=0: for j from 1 to numbpart(n) do for i from 1 to nops(P[j]) do if isprime(P[j][i])=true then c:=c+1 else c:=c fi: od: od: c: end: seq(a(n),n=1..42); # Emeric Deutsch, Mar 30 2006
    # second Maple program
    b:= proc(n, i) option remember; local g;
          if n=0 or i=1 then [1, 0]
        else g:= `if`(i>n, [0$2], b(n-i, i));
             b(n, i-1) +g +[0, `if`(isprime(i), g[1], 0)]
          fi
        end:
    a:= n-> b(n, n)[2]:
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 27 2012
  • Mathematica
    a[n_] := Sum[PrimeNu[k]*PartitionsP[n - k], {k, 1, n}]; Array[a, 100] (* Jean-François Alcover, Mar 16 2015, after Vladeta Jovovic *)
  • PARI
    a(n)={sum(k=1, n, omega(k)*numbpart(n-k))} \\ Andrew Howroyd, Dec 28 2017

Formula

a(n) = Sum_{k=1..n} A001221(k)*A000041(n-k). - Vladeta Jovovic, Aug 22 2002
a(n) = Sum_{k=1..floor(n/2)} k*A222656(n,k). - Alois P. Heinz, May 29 2013
G.f.: Sum_{i>=1} x^prime(i)/(1 - x^prime(i)) / Product_{j>=1} (1 - x^j). - Ilya Gutkovskiy, Jan 24 2017

Extensions

More terms from Naohiro Nomoto, Apr 19 2002

A224344 Number T(n,k) of compositions of n using exactly k primes (counted with multiplicity); triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 2, 5, 1, 3, 8, 5, 5, 13, 13, 1, 7, 23, 27, 7, 11, 39, 52, 25, 1, 17, 65, 99, 66, 9, 27, 106, 186, 151, 41, 1, 40, 177, 340, 323, 133, 11, 61, 293, 608, 666, 358, 61, 1, 92, 482, 1076, 1330, 867, 236, 13, 142, 781, 1894, 2581, 1971, 737, 85, 1
Offset: 0

Views

Author

Alois P. Heinz, May 23 2013

Keywords

Examples

			A(5,1) = 8: [2,1,1,1], [1,2,1,1], [1,1,2,1], [1,1,1,2], [3,1,1], [1,3,1], [1,1,3], [5].
Triangle T(n,k) begins:
   1;
   1;
   1,   1;
   1,   3;
   2,   5,   1;
   3,   8,   5;
   5,  13,  13,   1;
   7,  23,  27,   7;
  11,  39,  52,  25,   1;
  17,  65,  99,  66,   9;
  27, 106, 186, 151,  41,  1;
  40, 177, 340, 323, 133, 11;
  ...
		

Crossrefs

Column k=0 gives: A052284.
Row sums are: A011782.
Row lengths are: A008619.
T(floor(n/2)) = A093178(n).
T(2n,n-1) = A001844(n-1) for n>0.

Programs

  • Maple
    T:= proc(n) option remember; local j; if n=0 then 1
          else []; for j to n do zip((x, y)->x+y, %,
          [`if`(isprime(j), 0, NULL), T(n-j)], 0) od; %[] fi
        end:
    seq(T(n), n=0..16);
  • Mathematica
    zip[f_, x_List, y_List, z_] :=  With[{m = Max[Length[x], Length[y]]},  Thread[f[PadRight[x, m, z], PadRight[y, m, z]]]]; T[n_] := T[n] =  Module[{j, pc}, If[n == 0, {1}, pc = {}; For[j = 1, j <= n, j++, pc = zip[Plus, pc, Join[If[PrimeQ[j], {0}, {}], T[n-j]], 0]]; pc]]; Table[T[n], {n, 0, 16}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)

Formula

Sum_{k=1..floor(n/2)} k * T(n,k) = A102291(n).

A299730 Irregular triangle read by rows: T(n,k) is the number of partitions of 3*n having exactly k prime parts; n >= 0, 0 <= k <= floor( 3*n / 2 ).

Original entry on oeis.org

1, 1, 2, 3, 4, 3, 1, 6, 9, 8, 5, 2, 12, 20, 19, 14, 8, 3, 1, 19, 41, 42, 34, 21, 12, 5, 2, 37, 72, 88, 74, 53, 31, 18, 8, 3, 1, 58, 136, 161, 155, 115, 77, 46, 25, 12, 5, 2, 102, 226, 307, 291, 241, 168, 110, 65, 35, 18, 8, 3, 1
Offset: 0

Views

Author

J. Stauduhar, Feb 17 2018

Keywords

Comments

Sequence of row lengths = A001651.

Examples

			The irregular triangle T(n, k) begins:
3n\k  0   1   2   3   4   5   6   7   8   9
0:    1
3:    1   2
6:    3   4   3   1
9:    6   9   8   5   2
12:  12  20  19  14   8   3   1
15:  19  41  42  34  21  12   5   2
18:  37  72  88  74  53  31  18   8   3   1
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; expand(`if`(n=0 or i=1, 1,
          add(b(n-i*j, i-1)*`if`(isprime(i), x^j, 1), j=0..n/i)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(3*n$2)):
    seq(T(n), n=0..12);  # Alois P. Heinz, Mar 03 2018
  • Mathematica
    b[n_, i_] := b[n, i] = Expand[If[n == 0 || i == 1, 1,
         Sum[b[n - i*j, i - 1]*If[PrimeQ[i], x^j, 1], {j, 0, n/i}]]];
    T[n_] := CoefficientList[b[3n, 3n], x];
    T /@ Range[0, 12] // Flatten (* Jean-François Alcover, Mar 08 2021, after Alois P. Heinz *)

Formula

T(n,k) = A222656(3n,k).

A274517 Number T(n,k) of integer partitions of n with exactly k distinct primes.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 3, 2, 4, 1, 3, 7, 1, 3, 9, 3, 5, 12, 5, 6, 15, 9, 8, 22, 11, 1, 8, 28, 19, 1, 12, 38, 24, 3, 13, 46, 38, 4, 17, 62, 48, 8, 19, 77, 68, 12, 26, 98, 87, 20, 28, 117, 127, 24, 1, 37, 152, 154, 41, 1, 40, 183, 210, 55, 2, 52, 230, 260, 82, 3
Offset: 0

Views

Author

Geoffrey Critzer, Jun 25 2016

Keywords

Comments

Row lengths increase by 1 at row A007504(n).
Columns k=0-1 give: A002095, A132381.
Row sums give: A000041.

Examples

			T(6,1) = 7 because we have: 5+1, 4+2, 3+3, 3+1+1+1, 2+2+2, 2+2+1+1, 2+1+1+1+1+1.
Triangle T(n,k) begins:
  1;
  1;
  1,  1;
  1,  2;
  2,  3;
  2,  4,  1;
  3,  7,  1;
  3,  9,  3;
  5, 12,  5;
  6, 15,  9;
  8, 22, 11, 1;
  ...
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; expand(
          `if`(n=0, 1, `if`(i<1, 0, add(b(n-i*j, i-1)*
          `if`(j>0 and isprime(i), x, 1), j=0..n/i))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n$2)):
    seq(T(n), n=0..30);  # Alois P. Heinz, Jun 26 2016
  • Mathematica
    nn = 20; Map[Select[#, # > 0 &] &, CoefficientList[Series[Product[
          1/(1 - z^k), {k,Select[Range[1000], PrimeQ[#] == False &]}] Product[
          u/(1 - z^j) - u + 1, {j, Table[Prime[n], {n, 1, nn}]}], {z, 0,
         nn}], {z, u}]] // Grid

Formula

G.f.: Product_{k>=1} (1 - x^prime(k))/(1 - x^k)*(y/(1-x^prime(k)) - y + 1).

A299731 Number of partitions of 3*n that have exactly n prime parts.

Original entry on oeis.org

1, 2, 3, 5, 8, 12, 18, 25, 35, 50, 69, 93, 126, 167, 220, 290, 377, 486, 627, 800, 1017, 1290, 1623, 2032, 2542, 3161, 3917, 4843, 5960, 7312, 8957, 10925, 13291, 16139, 19534, 23588, 28437, 34180, 41000, 49099, 58657, 69941, 83269, 98917, 117314, 138930
Offset: 0

Views

Author

J. Stauduhar, Feb 18 2018

Keywords

Examples

			For n = 3: the five partitions of 3 * 3 = 9 that have exactly three prime parts are (5, 2, 2), (3, 3, 3), (3, 3, 2, 1), (3, 2, 2, 1, 1), and (2, 2, 2, 1, 1, 1), so a(3) = 5.
		

Crossrefs

Programs

  • Mathematica
    zip[f_, x_, y_, z_] := With[{m = Max[Length[x], Length[y]]}, Thread[f[ PadRight[x, m, z], PadRight[y, m, z]]]];
    b[n_, i_] := b[n, i] = Module[{j, pc}, Which[n == 0, {1}, i < 1, {0}, True, pc = {}; For[j = 0, j <= n/i, j++, pc = zip[Plus, pc, Join[If[PrimeQ[i], Array[0 &, j], {}], b[n - i*j, i - 1]], 0]]; pc]];
    a[n_] := b[3 n, 3 n][[n + 1]];
    Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Mar 16 2018, after Alois P. Heinz *)
  • PARI
    a(n) = {my(nb = 0); forpart(p=3*n, if (sum(k=1, #p, isprime(p[k])) == n, nb++);); nb;} \\ Michel Marcus, Mar 22 2018
  • Python
    See Stauduhar link.
    

Formula

a(n) = A222656(3*n,n).

A299732 a(n) has exactly (a(n) - n) / 2 partitions with exactly (a(n) - n) / 2 prime parts.

Original entry on oeis.org

2, 5, 8, 13, 20, 29, 42, 57, 78, 109, 148, 197, 264, 347, 454, 595, 770, 989, 1272, 1619, 2054, 2601, 3268, 4087, 5108, 6347, 7860, 9713, 11948, 14653, 17944, 21881, 26614, 32311, 39102, 47211, 56910, 68397, 82038, 98237, 117354, 139923, 166580, 197877, 234672
Offset: 0

Views

Author

J. Stauduhar, Feb 18 2018

Keywords

Comments

If B={b(n)} is the complement of A299731 then no number exists that has exactly b(n) partitions that have exactly b(n) prime parts, so this sequence lists only those numbers that can have the equality property.
Up to a(44) = 234672 (currently, the last term), except for 2,5,8, and 29, every term is the sum of distinct previous terms. Will this be true for all new terms?

Examples

			For n = 3: A299731(3) = 5. a(3) = 2*5 + 3 = 13. The five partitions of 13 that have exactly five prime parts are: (5,2,2,2,2), (3,3,3,2,2), (3,3,2,2,2,1), (3,2,2,2,2,1,1), and (2,2,2,2,2,1,1,1), so a(3) = 13.
		

Crossrefs

Programs

  • Python
    # See Stauduhar link.

Formula

a(n) = 2*A299731(n) + n = 2*A222656(3*n,n) + n.
Showing 1-7 of 7 results.