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.

Previous Showing 21-30 of 67 results. Next

A066185 Sum of the first moments of all partitions of n with weights starting at 0.

Original entry on oeis.org

0, 0, 1, 4, 12, 26, 57, 103, 191, 320, 537, 843, 1342, 2015, 3048, 4457, 6509, 9250, 13170, 18316, 25483, 34853, 47556, 64017, 86063, 114285, 151462, 198871, 260426, 338275, 438437, 564131, 724202, 924108, 1176201, 1489237, 1881273, 2365079, 2966620, 3705799
Offset: 0

Views

Author

Wouter Meeussen, Dec 15 2001

Keywords

Comments

The first element of each partition is given weight 0.
Consider the partitions of n, e.g., n=5. For each partition sum T(e-1) and sum all these. E.g., 5 -> T(4)=10, 41 -> T(3)+T(0)=6, 32 -> T(2)+T(1)=4, 311 -> T(2)+T(0)+T(0)=3, 221 -> T(1)+T(1)+T(0)=2, 21111 ->1 and 11111 ->0. Summing, 10+6+4+3+2+1+0 = 26 as desired. - Jon Perry, Dec 12 2003
Also equals the sum of f(p) over the partitions p of n, where f(p) is obtained by replacing each part p_i of partition p by p_i*(p_i-1)/2. See I. G. Macdonald: Symmetric functions and Hall polynomials 2nd edition, p. 3, eqn (1.5) and (1.6). - Wouter Meeussen, Sep 25 2014

Examples

			a(3)=4 because the first moments of all partitions of 3 are {3}.{0},{2,1}.{0,1} and {1,1,1}.{0,1,2}, resulting in 0,1,3; summing to 4.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 or i=1, [1, 0],
          b(n, i-1)+(h-> h+[0, h[1]*i*(i-1)/2])(b(n-i, min(n-i, i))))
        end:
    a:= n-> b(n$2)[2]:
    seq(a(n), n=0..50);  # Alois P. Heinz, Jan 29 2014
  • Mathematica
    Table[ Plus@@ Map[ #.Range[ 0, -1+Length[ # ] ]&, IntegerPartitions[ n ] ], {n, 40} ]
    b[n_, i_] := b[n, i] = If[n==0, {1, 0}, If[i<1, {0, 0}, If[i>n, b[n, i-1], b[n, i-1] + Function[h, h+{0, h[[1]]*i*(i-1)/2}][b[n-i, i]]]]]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Oct 26 2015, after Alois P. Heinz *)

Formula

a(n) = 1/2*(A066183(n) - A066186(n)). - Vladeta Jovovic, Mar 23 2003
G.f.: Sum_{k>=1} x^(2*k)/(1 - x^k)^3 / Product_{j>=1} (1 - x^j). - Ilya Gutkovskiy, Mar 05 2021
a(n) = Sum_{k=0..A161680(n)} k * A264034(n,k). - Alois P. Heinz, Jan 20 2023
a(n) ~ 3 * zeta(3) * sqrt(n) * exp(Pi*sqrt(2*n/3)) / (sqrt(2) * Pi^3). - Vaclav Kotesovec, Jul 06 2025

A174794 a(0) = 0 and a(n) = (4*n^3 - 12*n^2 + 20*n - 9)/3 for n >= 1.

Original entry on oeis.org

0, 1, 5, 17, 45, 97, 181, 305, 477, 705, 997, 1361, 1805, 2337, 2965, 3697, 4541, 5505, 6597, 7825, 9197, 10721, 12405, 14257, 16285, 18497, 20901, 23505, 26317, 29345, 32597, 36081, 39805, 43777, 48005, 52497, 57261, 62305, 67637, 73265, 79197, 85441, 92005, 98897
Offset: 0

Views

Author

Roger L. Bagula, Mar 29 2010

Keywords

Comments

For n >= 1, a(n+1) = (4*n^3 + 8*n + 3)/3 is the number of evaluation points on the n-dimensional cube in Stenger's degree 7 cubature rule. - Franck Maminirina Ramaharo, Dec 18 2018

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[x*(1 + x)*(1 + 3*x^2)/(1 - x)^4, {x, 0, 50}], x]
  • Maxima
    a[0] : 0$ a[n] := (4*n^3 - 12*n^2 + 20*n - 9)/3$ makelist(a[n], n, 0, 50); /* Martin Ettl, Oct 21 2012 */

Formula

G.f.: x*(1 + x)*(1 + 3*x^2)/(1 - x)^4.
From Franck Maminirina Ramaharo, Dec 17 2018: (Start)
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4), n >= 5.
a(n) = 8*binomial(n - 1, 3) + 8*binomial(n - 1, 2) + 4*binomial(n - 1, 1) + 1, n >= 1.
E.g.f.: (9 - (9 - 12*x - 4*x^3)*exp(x))/3. (End)

Extensions

Definition replaced by polynomial - The Assoc. Eds. of the OEIS, Aug 10 2010

A381476 Triangle read by rows: T(n,k) is the number of subsets of {1..n} with k elements such that every pair of distinct elements has a different difference, 0 <= k <= A143824(n).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 4, 6, 2, 1, 5, 10, 6, 1, 6, 15, 14, 1, 7, 21, 26, 2, 1, 8, 28, 44, 10, 1, 9, 36, 68, 26, 1, 10, 45, 100, 60, 1, 11, 55, 140, 110, 1, 12, 66, 190, 190, 4, 1, 13, 78, 250, 304, 22, 1, 14, 91, 322, 466, 68, 1, 15, 105, 406, 676, 156
Offset: 0

Views

Author

Andrew Howroyd, Mar 27 2025

Keywords

Comments

Equivalently, a(n) is the number of Sidon sets of {1..n} of size k.

Examples

			Triangle begins:
   0 | 1;
   1 | 1,  1;
   2 | 1,  2,  1;
   3 | 1,  3,  3;
   4 | 1,  4,  6,   2;
   5 | 1,  5, 10,   6;
   6 | 1,  6, 15,  14;
   7 | 1,  7, 21,  26,   2;
   8 | 1,  8, 28,  44,  10;
   9 | 1,  9, 36,  68,  26;
  10 | 1, 10, 45, 100,  60;
  11 | 1, 11, 55, 140, 110;
  12 | 1, 12, 66, 190, 190, 4;
  ...
		

Crossrefs

Columns 0..5 are A000012, A001477, A161680, A212964(n-1), A241688, A241689, A241690.
Row sums are A143823.

Programs

  • PARI
    row(n)={
      local(L=List());
      my(recurse(k,r,b,w)=
          if(k > n, if(r>=#L,listput(L,0)); L[1+r]++,
             self()(k+1, r, b, w);
             b+=1<
    				

Formula

T(n,A143824(n)) = A382395(n).

A068605 Number of functions from [1,2,...,n] to [1,2,...,n] such that the image contains exactly two elements.

Original entry on oeis.org

2, 18, 84, 300, 930, 2646, 7112, 18360, 45990, 112530, 270204, 638820, 1490762, 3440430, 7864080, 17825520, 40107726, 89652906, 199229060, 440401500, 968883762, 2122317318, 4630511064, 10066329000, 21810380150, 47110421826, 101468601612, 217969589460, 467077692570
Offset: 2

Views

Author

Sharon Sela (sharonsela(AT)hotmail.com), Mar 29 2002

Keywords

Comments

The sequence is the column corresponding to k=2 in A090657. - Geoffrey Critzer, Mar 06 2009

Crossrefs

Programs

  • Mathematica
    Table[ Binomial[n, 2]*(2^n - 2), {n, 2, 30}]
  • Python
    def A068605(n): return n*(n-1)*((1<Chai Wah Wu, Jun 20 2025

Formula

a(n) = C(n, 2) * (2^n - 2).
O.g.f.: (4x^2/(1-2x)^3) - (2x^2/(1-x)^3). - Geoffrey Critzer, Mar 06 2009
E.g.f.: exp(x)*(2*exp(x) - 1)*x^2. - Stefano Spezia, May 06 2023

Extensions

Edited and extended by Robert G. Wilson v, Apr 17 2002

A198295 Riordan array (1, x*(1+x)/(1-x^3)).

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 0, 2, 1, 0, 1, 1, 3, 1, 0, 1, 2, 3, 4, 1, 0, 0, 4, 4, 6, 5, 1, 0, 1, 2, 9, 8, 10, 6, 1, 0, 1, 3, 9, 17, 15, 15, 7, 1, 0, 0, 6, 9, 24, 30, 26, 21, 8, 1, 0, 1, 3, 18, 26, 51, 51, 42, 28, 9, 1
Offset: 0

Views

Author

Philippe Deléham, Jan 26 2012

Keywords

Comments

Triangle T(n,k), read by rows, given by (0, 1, -1, -1, 2, -1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (1, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938.
Antidiagonals sums: see A159284.

Examples

			Triangle begins:
1
0, 1
0, 1, 1
0, 0, 2, 1
0, 1, 1, 3, 1
0, 1, 2, 3, 4, 1
0, 0, 4, 4, 6, 5, 1
0, 1, 2, 9, 8, 10, 6, 1
0, 1, 3, 9, 17, 15, 15, 7, 1
		

References

  • A. Luzón, D. Merlini, M. A. Morón, R. Sprugnoli, Complementary Riordan arrays, Discrete Applied Mathematics, 172 (2014) 75-87.

Crossrefs

Cf. Diagonals: A000012, A001477, A161680, A000125.

Formula

Sum_{k, 0<=k<=n} T(n,k) = A001590(n+2), n>0.
Sum_{k, 0<=k<=n}T(n,k)*(-1)^(n-k) = A078056(n-1), n>0.
T(n,n) = A000012(n), T(n+1,n) = A001477(n) = n, T(n+2,n) = A161680(n) = A000217(n-1); T(n+3,n) = A000125(n-1), n>=1.
G.f.: (-1+x)*(1+x+x^2)/(-1+x^3+x*y+x^2*y). - R. J. Mathar, Aug 11 2015

A322594 a(n) = (4*n^3 + 12*n^2 - 4*n + 3)/3.

Original entry on oeis.org

1, 5, 25, 69, 145, 261, 425, 645, 929, 1285, 1721, 2245, 2865, 3589, 4425, 5381, 6465, 7685, 9049, 10565, 12241, 14085, 16105, 18309, 20705, 23301, 26105, 29125, 32369, 35845, 39561, 43525, 47745, 52229, 56985, 62021, 67345, 72965, 78889, 85125, 91681, 98565
Offset: 0

Views

Author

Keywords

Comments

a(n) is the number of evaluation points on the n-dimensional cube in Lyness's degree 7 cubature rule.

References

  • Arthur H. Stroud, Approximate calculation of multiple integrals, Prentice-Hall, 1971.

Crossrefs

Programs

  • Mathematica
    Table[(4*n^3 + 12*n^2 - 4*n + 3)/3, {n, 0, 50}]
  • Maxima
    makelist((4*n^3 + 12*n^2 - 4*n + 3)/3, n, 0, 50);

Formula

a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4), n >= 5.
a(n) = a(n-1) + 4*A028387(n-1), n >= 1.
a(n) = 8*binomial(n, 3) + 16*binomial(n, 2) + 4*binomial(n, 1) + 1.
G.f.: (1 + x + 11*x^2 - 5*x^3)/(1 - x)^4
E.g.f.: (1/3)*(3 + 12*x + 24*x^2 + 4*x^3)*exp(x).

A322595 a(n) = (n^3 + 9*n + 14*n + 9)/3.

Original entry on oeis.org

3, 11, 21, 35, 55, 83, 121, 171, 235, 315, 413, 531, 671, 835, 1025, 1243, 1491, 1771, 2085, 2435, 2823, 3251, 3721, 4235, 4795, 5403, 6061, 6771, 7535, 8355, 9233, 10171, 11171, 12235, 13365, 14563, 15831, 17171, 18585, 20075, 21643, 23291, 25021, 26835
Offset: 0

Views

Author

Keywords

Comments

For n >= 6, a(n) is the number of evaluating points on the hypersphere in R^n in Stoyanovas's degree 7 cubature rule.

Crossrefs

First differences: A027693.

Programs

  • Magma
    [(n^3 + 9*n + 14*n + 9)/3: n in [0..45]]; // Vincenzo Librandi, Jun 05 2019
  • Mathematica
    Table[(n^3 + 9*n + 14*n + 9)/3, {n, 0, 50}]
    LinearRecurrence[{4,-6,4,-1},{3,11,21,35},50] (* Harvey P. Dale, Aug 19 2020 *)
  • Maxima
    makelist((n^3 + 9*n + 14*n + 9)/3, n, 0, 50);
    

Formula

a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4), n >= 4.
a(n) = 2*binomial(n + 1, 3) + 6*binomial(n + 1, 2) + 2*binomial(n + 1, 1) + 1.
G.f.: (3 - x - 5*x^2 + 5*x^3)/(1 - x)^4. [Corrected by Georg Fischer, May 23 2019]
E.g.f.: (1/3)*(9 + 24*x + 12*x^2 + x^3)*exp(x).

A323294 Number of 3-uniform hypergraphs spanning n labeled vertices where every two edges have two vertices in common.

Original entry on oeis.org

1, 0, 0, 1, 11, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, 1326, 1378, 1431
Offset: 0

Views

Author

Gus Wiseman, Jan 10 2019

Keywords

Examples

			The a(4) = 11 hypergraphs:
  {{1,2,3},{1,2,4}}
  {{1,2,3},{1,3,4}}
  {{1,2,3},{2,3,4}}
  {{1,2,4},{1,3,4}}
  {{1,2,4},{2,3,4}}
  {{1,3,4},{2,3,4}}
  {{1,2,3},{1,2,4},{1,3,4}}
  {{1,2,3},{1,2,4},{2,3,4}}
  {{1,2,3},{1,3,4},{2,3,4}}
  {{1,2,4},{1,3,4},{2,3,4}}
  {{1,2,3},{1,2,4},{1,3,4},{2,3,4}}
		

Crossrefs

Programs

  • Mathematica
    stableSets[u_,Q_]:=If[Length[u]===0,{{}},With[{w=First[u]},Join[stableSets[DeleteCases[u,w],Q],Prepend[#,w]&/@stableSets[DeleteCases[u,r_/;r===w||Q[r,w]||Q[w,r]],Q]]]];
    Table[Length[Select[stableSets[Subsets[Range[n],{3}],Length[Intersection[#1,#2]]<=1&],Union@@#==Range[n]&]],{n,10}]
  • PARI
    seq(n)={Vec(serlaplace(1 - x^2/2 - x^3/3 + 5*x^4/24 + x^2*exp(x + O(x^(n-1)))/2))} \\ Andrew Howroyd, Aug 18 2019

Formula

a(n) = binomial(n,2) for n >= 5. - Gus Wiseman, Jan 16 2019
Binomial transform is A289837. - Gus Wiseman, Jan 16 2019
a(n) = A000217(n-1) for n >= 5. - Alois P. Heinz, Jan 24 2019
E.g.f.: 1 - x^2/2 - x^3/3 + 5*x^4/24 + x^2*exp(x)/2. - Andrew Howroyd, Aug 18 2019

A331518 a(n) = Sum_{k=0..n} q(n,k) * !k, where q(n,k) = number of partitions of n into k distinct parts and !k = subfactorial of k.

Original entry on oeis.org

1, 0, 0, 1, 1, 2, 4, 5, 7, 10, 21, 24, 37, 49, 71, 129, 160, 227, 313, 433, 572, 1012, 1213, 1750, 2315, 3223, 4159, 5740, 8945, 11206, 15402, 20506, 27545, 36068, 48122, 61960, 94694, 116240, 158580, 205397, 276458, 352526, 470101, 596433, 781224, 1111228
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 19 2020

Keywords

Comments

a(n) is the number of permutations of [n] whose fixed points sum to n*(n-1)/2. a(6) = 4: 143256, 231456, 312456, 523416. - Alois P. Heinz, Mar 02 2024

Crossrefs

Programs

  • Maple
    g:= proc(n) option remember; `if`(n=0, 1, n*g(n-1)+(-1)^n) end:
    b:= proc(n, i, m) option remember; `if`(n>i*(i+1)/2, 0,
         `if`(n=0, g(m), b(n, i-1, m)+b(n-i, min(n-i, i-1), m+1)))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..45);  # Alois P. Heinz, Mar 02 2024
  • Mathematica
    Table[Sum[Length[Select[IntegerPartitions[n, {k}], UnsameQ @@ # &]] Subfactorial[k], {k, 0, n}], {n, 0, 45}]
    nmax = 45; CoefficientList[Series[Sum[Subfactorial[k] x^(k (k + 1)/2)/Product[(1 - x^j), {j, 1, k}], {k, 0, nmax}], {x, 0, nmax}], x]
    nmax = 50; CoefficientList[Series[Sum[Subfactorial[k] * x^(k*(k+1)/2) / Product[(1 - x^j), {j, 1, k}], {k, 0, Sqrt[2*nmax]}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Jan 28 2020 *)

Formula

G.f.: Sum_{k>=0} !k * x^(k*(k + 1)/2) / Product_{j=1..k} (1 - x^j).
a(n) = A369596(n,A161680(n)). - Alois P. Heinz, Mar 02 2024

A369596 Number T(n,k) of permutations of [n] whose fixed points sum to k; triangle T(n,k), n>=0, 0<=k<=A000217(n), read by rows.

Original entry on oeis.org

1, 0, 1, 1, 0, 0, 1, 2, 1, 1, 1, 0, 0, 1, 9, 2, 2, 3, 3, 2, 1, 1, 0, 0, 1, 44, 9, 9, 11, 11, 13, 5, 5, 4, 4, 2, 1, 1, 0, 0, 1, 265, 44, 44, 53, 53, 62, 64, 29, 22, 24, 16, 16, 8, 6, 5, 4, 2, 1, 1, 0, 0, 1, 1854, 265, 265, 309, 309, 353, 362, 406, 150, 159, 126, 126, 93, 86, 44, 36, 29, 19, 19, 9, 7, 5, 4, 2, 1, 1, 0, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, Mar 02 2024

Keywords

Examples

			T(3,0) = 2: 231, 312.
T(3,1) = 1: 132.
T(3,2) = 1: 321.
T(3,3) = 1: 213.
T(3,6) = 1: 123.
T(4,0) = 9: 2143, 2341, 2413, 3142, 3412, 3421, 4123, 4312, 4321.
Triangle T(n,k) begins:
   1;
   0, 1;
   1, 0, 0,  1;
   2, 1, 1,  1,  0,  0, 1;
   9, 2, 2,  3,  3,  2, 1, 1, 0, 0, 1;
  44, 9, 9, 11, 11, 13, 5, 5, 4, 4, 2, 1, 1, 0, 0, 1;
  ...
		

Crossrefs

Column k=0 gives A000166.
Column k=3 gives A000255(n-2) for n>=2.
Row sums give A000142.
Row lengths give A000124.
Reversed rows converge to A331518.
T(n,n) gives A369796.

Programs

  • Maple
    b:= proc(s) option remember; (n-> `if`(n=0, 1, add(expand(
          `if`(j=n, x^j, 1)*b(s minus {j})), j=s)))(nops(s))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b({$1..n})):
    seq(T(n), n=0..7);
    # second Maple program:
    g:= proc(n) option remember; `if`(n=0, 1, n*g(n-1)+(-1)^n) end:
    b:= proc(n, i, m) option remember; `if`(n>i*(i+1)/2, 0,
         `if`(n=0, g(m), b(n, i-1, m)+b(n-i, min(n-i, i-1), m-1)))
        end:
    T:= (n, k)-> b(k, min(n, k), n):
    seq(seq(T(n, k), k=0..n*(n+1)/2), n=0..7);
  • Mathematica
    g[n_] := g[n] = If[n == 0, 1, n*g[n - 1] + (-1)^n];
    b[n_, i_, m_] := b[n, i, m] = If[n > i*(i + 1)/2, 0,
       If[n == 0, g[m], b[n, i-1, m] + b[n-i, Min[n-i, i-1], m-1]]];
    T[n_, k_] := b[k, Min[n, k], n];
    Table[Table[T[n, k], {k, 0, n*(n + 1)/2}], {n, 0, 7}] // Flatten (* Jean-François Alcover, May 24 2024, after Alois P. Heinz *)

Formula

Sum_{k=0..A000217(n)} k * T(n,k) = A001710(n+1) for n >= 1.
Sum_{k=0..A000217(n)} (1+k) * T(n,k) = A038720(n) for n >= 1.
Sum_{k=0..A000217(n)} (n*(n+1)/2-k) * T(n,k) = A317527(n+1).
T(n,A161680(n)) = A331518(n).
T(n,A000217(n)) = 1.
Previous Showing 21-30 of 67 results. Next