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

A087787 a(n) = Sum_{k=0..n} (-1)^(n-k)*A000041(k).

Original entry on oeis.org

1, 0, 2, 1, 4, 3, 8, 7, 15, 15, 27, 29, 48, 53, 82, 94, 137, 160, 225, 265, 362, 430, 572, 683, 892, 1066, 1370, 1640, 2078, 2487, 3117, 3725, 4624, 5519, 6791, 8092, 9885, 11752, 14263, 16922, 20416, 24167, 29007, 34254, 40921, 48213, 57345, 67409
Offset: 0

Views

Author

Vladeta Jovovic, Oct 07 2003

Keywords

Comments

Essentially first differences of A024786 (see the formula). Also, a(n) is the number of 2's in the last section of the set of partitions of n+2 (see A135010). - Omar E. Pol, Sep 10 2008
From Gus Wiseman, May 20 2024: (Start)
Also the number of integer partitions of n containing an even number of ones, ranked by A003159. The a(0) = 1 through a(8) = 15 partitions are:
() . (2) (3) (4) (5) (6) (7) (8)
(11) (22) (32) (33) (43) (44)
(211) (311) (42) (52) (53)
(1111) (222) (322) (62)
(411) (511) (332)
(2211) (3211) (422)
(21111) (31111) (611)
(111111) (2222)
(3311)
(4211)
(22211)
(41111)
(221111)
(2111111)
(11111111)
Also the number of integer partitions of n + 1 containing an odd number of ones, ranked by A036554.
(End)

Crossrefs

The unsigned version is A000070, strict A036469.
For powers of 2 instead number of partitions we have A001045.
The strict or odd version is A025147 or A096765.
The ordered version (compositions instead of partitions) is A078008.
For powers of 2 instead of -1 we have A259401, cf. A259400.
A002865 counts partitions with no ones, column k=0 of A116598.
A072233 counts partitions by sum and length.

Programs

  • Mathematica
    Table[Sum[(-1)^(n-k)*PartitionsP[k], {k,0,n}], {n,0,50}] (* Vaclav Kotesovec, Aug 16 2015 *)
    (* more efficient program *) sig = 1; su = 1; Flatten[{1, Table[sig = -sig; su = su + sig*PartitionsP[n]; Abs[su], {n, 1, 50}]}] (* Vaclav Kotesovec, Nov 06 2016 *)
    Table[Length[Select[IntegerPartitions[n], EvenQ[Count[#,1]]&]],{n,0,30}] (* Gus Wiseman, May 20 2024 *)
  • Python
    from sympy import npartitions
    def A087787(n): return sum(-npartitions(k) if n-k&1 else npartitions(k) for k in range(n+1)) # Chai Wah Wu, Oct 25 2023

Formula

G.f.: 1/(1+x)*1/Product_{k>0} (1-x^k).
a(n) = 1/n*Sum_{k=1..n} (sigma(k)+(-1)^k)*a(n-k).
a(n) = A024786(n+2)-A024786(n+1). - Omar E. Pol, Sep 10 2008
a(n) ~ exp(Pi*sqrt(2*n/3)) / (8*sqrt(3)*n) * (1 + (11*Pi/(24*sqrt(6)) - sqrt(3/2)/Pi)/sqrt(n) - (11/16 + (23*Pi^2)/6912)/n). - Vaclav Kotesovec, Nov 05 2016
a(n) = A000041(n) - a(n-1). - Jon Maiga, Aug 29 2019
Alternating partial sums of A000041. - Gus Wiseman, May 20 2024

A292746 Triangle read by rows: T(n,k) (n>=0, 0<=k<=n) = number of partitions of n with exactly k kinds of 1's which are introduced in ascending order.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 1, 2, 3, 1, 2, 3, 8, 6, 1, 2, 5, 19, 26, 10, 1, 4, 7, 43, 97, 66, 15, 1, 4, 11, 93, 334, 361, 141, 21, 1, 7, 15, 197, 1095, 1778, 1066, 267, 28, 1, 8, 22, 409, 3482, 8207, 7108, 2668, 463, 36, 1, 12, 30, 840, 10855, 36310, 43747, 23116, 5909, 751, 45, 1
Offset: 0

Views

Author

Alois P. Heinz, Sep 22 2017

Keywords

Examples

			T(3,0) = 1: 3.
T(3,1) = 2: 21a, 1a1a1a.
T(3,2) = 3: 1a1a1b, 1a1b1a, 1a1b1b. (The two kinds of 1's are labeled 1a and 1b)
T(3,3) = 1: 1a1b1c.
Triangle T(n,k) begins:
  1;
  0,  1;
  1,  1,   1;
  1,  2,   3,    1;
  2,  3,   8,    6,    1;
  2,  5,  19,   26,   10,    1;
  4,  7,  43,   97,   66,   15,    1;
  4, 11,  93,  334,  361,  141,   21,   1;
  7, 15, 197, 1095, 1778, 1066,  267,  28,  1;
  8, 22, 409, 3482, 8207, 7108, 2668, 463, 36, 1;
  ...
		

Crossrefs

Columns k=0-10 give: A002865, A000041(n-1) for n>0, A259401(n-2) for n>1, A320816, A320817, A320818, A320819, A320820, A320821, A320822, A320823.
Main diagonal and first lower diagonal give: A000012, A000217.
Row sums give A292503.
T(2n,n) gives A292747.

Programs

  • Maple
    f:= (n, k)-> add(Stirling2(n, j), j=0..k):
    b:= proc(n, i, k) option remember; `if`(n=0 or i<2,
          f(n, k), add(b(n-i*j, i-1, k), j=0..n/i))
        end:
    T:= (n, k)-> b(n$2, k)-`if`(k=0, 0, b(n$2, k-1)):
    seq(seq(T(n, k), k=0..n), n=0..14);
    # second Maple program:
    b:= proc(n, i, k) option remember; `if`(n=0 or i<2,
          k^n, b(n, i-1, k) +b(n-i, min(i, n-i), k))
        end:
    T:= (n, k)-> add((-1)^i*b(n$2, k-i)/((k-i)!*i!), i=0..k):
    seq(seq(T(n, k), k=0..n), n=0..14);
  • Mathematica
    f[n_, k_] := Sum[StirlingS2[n, j], {j, 0, k}];
    b[n_, i_, k_] := b[n, i, k] = If[n == 0 || i < 2, f[n, k], Sum[b[n - i*j, i - 1, k], {j, 0, n/i}]];
    T[n_, k_] := b[n, n, k] - If[k == 0, 0, b[n, n, k - 1]];
    Table[T[n, k], {n, 0, 14}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 17 2018, translated from Maple *)

Formula

T(n,k) = A292745(n,k) - A292745(n,k-1) for k>0. T(n,0) = A292745(n,0) = A002865(n).
T(n,k) = Sum_{i=0..k} (-1)^i * A292741(n, k-i) / ((k-i)!*i!).

Extensions

Definition clarified by N. J. A. Sloane, Dec 12 2020

A090764 Number of partitions of n with two sorts of part 1.

Original entry on oeis.org

1, 2, 5, 11, 24, 50, 104, 212, 431, 870, 1752, 3518, 7057, 14138, 28310, 56661, 113377, 226820, 453728, 907561, 1815259, 3630683, 7261576, 14523405, 29047130, 58094643, 116189764, 232380102, 464760912, 929522671, 1859046381, 3718094000, 7436189507, 14872380808
Offset: 0

Views

Author

Jon Perry, Feb 01 2004

Keywords

Comments

Original name was: a(n) = Sum_{pi = partition of n} 2^{number of 1's in pi}.
a(n) is the number of compositions of n consisting of two kinds of parts, p and p', when the order of all the primed parts does not matter; or equivalently, when the order of all the unprimed parts does not matter. - Gregory L. Simay, Sep 12 2017

Examples

			a(4) = 24 because the partitions of 4 are 4(1), 31(2), 22(1), 211(4) and 1111(16). 1+2+1+4+16=24.
a(4) = 24 because the compositions of 4 (when the parts are of two kinds, p and p', and the order of the primed parts does not matter) are 4; 4'; 3,1; 1,3; 3',1 = 1,3'; 3,1' = 1',3; 3'1' = 1'3'; 2,2; 2'2 = 2,2'; 2',2'; 2,1,1; 1,2,1; 1,1,2; 2,1,1'= 2,1',1 = 1',2,1; 2',1,1 = 1,2',1 = 1,1,2'; 2,1',1' = 1',2,1' = 1',1',2; 2',1',1 = 2',1,1'= 1,2',1' = 1',2',1 = 1',1,2' = 1,1',2'; 2',1',1' = 1',2',1' = 1',1',2'; 1,1,1,1; 1',1,1,1 = 1,1',1,1 = 1,1,1',1 = 1,1,1,1'; 1',1',1,1 = 1,1',1,1' = 1',1,1',1 = 1',1,1,1' = 1,1'1',1 = 1,1,1',1'; 1',1',1',1 = 1',1',1,1' = 1',1,1',1', 1,1',1',1'; 1',1',1',1'. - _Gregory L. Simay_, Sep 12 2017
a(4) = 24 because the convolution of the first 5 partition numbers with the first 5 composition numbers is 1*8 + 1*4 + 2*2 + 3*1 + 5*1 = 24. (Note that the first partition number is A000041(0)=1; and the first composition number is A011782(0)=1.) - _Gregory L. Simay_, Sep 15 2017
a(4) = 2*a(3) + A000041(4) - A000041(3) = 2*11 + 5 - 3 = 24. - _Gregory L. Simay_, Sep 16 2017
		

Crossrefs

Column k=2 of A292741.

Programs

  • Java
    import java.math.*; import java.io.*; public class A090764 { public static final int LIMIT = 80; public static final BigInteger TWO = new BigInteger("2"); public static void main(String[] args) throws Exception {BigInteger[] a = new BigInteger[LIMIT];
    int i, j; PrintStream out = new PrintStream(new FileOutputStream("A090764.txt")); a[0] = BigInteger.ONE;for (i = 1; i < LIMIT; i++)a[i] = a[i - 1].multiply(TWO); for (j = 2; j < LIMIT; j++)for (i = j; i < LIMIT; i++)
    a[i] = a[i - 1].multiply(TWO); for (j = 2; j < LIMIT; j++)for (i = j; i < LIMIT; i++) a[i] = a[i].add(a[i - j]);for (i = 0; i < LIMIT; i++)out.print(a[i] + " ");out.print(" ");}} // David Wasserman, Feb 10 2004
  • Maple
    b:= proc(n, i) option remember; `if`(n=0 or i<2, 2^n,
          add(b(n-i*j, i-1), j=0..iquo(n, i)))
        end:
    a:= n-> b(n, n):
    seq(a(n), n=0..40);  # Alois P. Heinz, Feb 19 2013
  • Mathematica
    c[n_] := Count[n, 1]; f[n_] := Apply[Plus, 2^Map[ c, IntegerPartitions[n] ]]; Table[ f[n], {n, 0, 31}] (* Robert G. Wilson v, Feb 12 2004 *)
    b[n_, i_] := b[n, i] = If[n == 0 || i < 2, 2^n, Sum[b[n - i*j, i - 1], {j, 0, Quotient[n, i]}]]; a[n_] := b[n, n]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Aug 29 2016, after Alois P. Heinz *)
    Table[PartitionsP[n] + Sum[2^(k-1)*PartitionsP[n-k], {k, 1, n}], {n, 0, 50}] (* Vaclav Kotesovec, Apr 10 2017 *)

Formula

G.f.: (1/(1-2*x))*Product_{m>=2} 1/(1-x^m). - Vladeta Jovovic, Feb 04 2004
Convolution of A000041 with A011782. In general, Sum_{pi = partition of n} k^{number of 1's in pi} is equal to the convolution of the partitions of n with the compositions of n having parts of (k-1) kinds; this is k=2. - Gregory L. Simay, Sep 15 2017
a(n) = 2*a(n-1) + A000041(n) - A000041(n-1). - Gregory L. Simay, Sep 16 2017
a(n) ~ c * 2^n, where c = Product_{n>=2} (2^n/(2^n-1)) = 1.7313733097275318... - Vaclav Kotesovec, Sep 17 2017

Extensions

More terms from David Wasserman, Feb 10 2004
a(0) inserted by Alois P. Heinz, Feb 19 2013
New name from Alois P. Heinz, Sep 21 2017

A259400 a(n) = Sum_{k=0..n} 2^k*p(k), where p(k) is the partition function A000041.

Original entry on oeis.org

1, 3, 11, 35, 115, 339, 1043, 2963, 8595, 23955, 66963, 181651, 497043, 1324435, 3536275, 9303443, 24442259, 63370643, 164296083, 421197203, 1078654355, 2739598739, 6942291347, 17469994387, 43894109587, 109593687443, 273070880147, 677066241427, 1675109266835
Offset: 0

Views

Author

Vaclav Kotesovec, Jun 26 2015

Keywords

Comments

In general, Sum_{k=0..n} (m^k * p(k)) ~ m/(m-1) * m^n * p(n), for m > 1.

Crossrefs

Partial sums of A327550.

Programs

  • Mathematica
    Table[Sum[2^k*PartitionsP[k],{k,0,n}],{n,0,40}]

Formula

a(n) ~ 2^(n-1) * exp(Pi*sqrt(2*n/3)) / (n*sqrt(3)).
Showing 1-4 of 4 results.