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

A026898 a(n) = Sum_{k=0..n} (n-k+1)^k.

Original entry on oeis.org

1, 2, 4, 9, 23, 66, 210, 733, 2781, 11378, 49864, 232769, 1151915, 6018786, 33087206, 190780213, 1150653921, 7241710930, 47454745804, 323154696185, 2282779990495, 16700904488706, 126356632390298, 987303454928973, 7957133905608837, 66071772829247410
Offset: 0

Views

Author

Keywords

Comments

Row sums of A004248, A009998, A009999.
First differences are in A047970.
First differences of A103439.
Antidiagonal sums of array A003992.
a(n-1), for n>=1, is the number of length-n restricted growth strings (RGS) [s(0),s(1),...,s(n-1)] where s(0)=0 and s(k)<=1+max(prefix) for k>=1, that are simultaneously projections as maps f: [n] -> [n] where f(x)<=x and f(f(x))=f(x); see example and the two comments (Arndt, Apr 30 2011 Jan 04 2013) in A000110. - Joerg Arndt, Mar 07 2015
Number of finite sequences s of length n+1 whose discriminator sequence is s itself. Here the discriminator sequence of s is the one where the n-th term (n>=1) is the least positive integer k such that the first n terms are pairwise incongruent, modulo k. - Jeffrey Shallit, May 17 2016
From Gus Wiseman, Jan 08 2019: (Start)
Also the number of set partitions of {1,...,n+1} whose minima form an initial interval of positive integers. For example, the a(3) = 9 set partitions are:
{{1},{2},{3},{4}}
{{1},{2},{3,4}}
{{1},{2,4},{3}}
{{1,4},{2},{3}}
{{1},{2,3,4}}
{{1,3},{2,4}}
{{1,4},{2,3}}
{{1,3,4},{2}}
{{1,2,3,4}}
Missing from this list are:
{{1},{2,3},{4}}
{{1,2},{3},{4}}
{{1,3},{2},{4}}
{{1,2},{3,4}}
{{1,2,3},{4}}
{{1,2,4},{3}}
(End)
a(n) is the number of m-tuples of nonnegative integers less than or equal to n-m (including the "0-tuple"). - Mathew Englander, Apr 11 2021

Examples

			G.f.: A(x) = 1 + 2*x + 4*x^2 + 9*x^3 + 23*x^4 + 66*x^5 + 210*x^6 + ...
where we have the identity:
A(x) = 1/(1-x) + x/(1-2*x) + x^2/(1-3*x) + x^3/(1-4*x) + x^4/(1-5*x) + ...
is equal to
A(x) = 1/(1-x) + x/((1-x)^2*(1+x)) + 2!*x^2/((1-x)^3*(1+x)*(1+2*x)) + 3!*x^3/((1-x)^4*(1+x)*(1+2*x)*(1+3*x)) + 4!*x^4/((1-x)^5*(1+x)*(1+2*x)*(1+3*x)*(1+4*x)) + ...
From _Joerg Arndt_, Mar 07 2015: (Start)
The a(5-1) = 23 RGS described in the comment are (dots denote zeros):
01:  [ . . . . . ]
02:  [ . 1 . . . ]
03:  [ . 1 . . 1 ]
04:  [ . 1 . 1 . ]
05:  [ . 1 . 1 1 ]
06:  [ . 1 1 . . ]
07:  [ . 1 1 . 1 ]
08:  [ . 1 1 1 . ]
09:  [ . 1 1 1 1 ]
10:  [ . 1 2 . . ]
11:  [ . 1 2 . 1 ]
12:  [ . 1 2 . 2 ]
13:  [ . 1 2 1 . ]
14:  [ . 1 2 1 1 ]
15:  [ . 1 2 1 2 ]
16:  [ . 1 2 2 . ]
17:  [ . 1 2 2 1 ]
18:  [ . 1 2 2 2 ]
19:  [ . 1 2 3 . ]
20:  [ . 1 2 3 1 ]
21:  [ . 1 2 3 2 ]
22:  [ . 1 2 3 3 ]
23:  [ . 1 2 3 4 ]
(End)
		

Crossrefs

Programs

  • Haskell
    a026898 n = sum $ zipWith (^) [n + 1, n .. 1] [0 ..]
    -- Reinhard Zumkeller, Sep 14 2014
    
  • Magma
    [(&+[(n-k+1)^k: k in [0..n]]): n in [0..50]]; // Stefano Spezia, Jan 09 2019
    
  • Maple
    a:= n-> add((n+1-j)^j, j=0..n): seq(a(n), n=0..23); # Zerinvary Lajos, Apr 18 2009
  • Mathematica
    Table[Sum[(n-k+1)^k, {k,0,n}], {n, 0, 25}] (* Michael De Vlieger, Apr 01 2015 *)
  • PARI
    {a(n)=polcoeff(sum(m=0,n,x^m/(1-(m+1)*x+x*O(x^n))),n)} /* Paul D. Hanna, Sep 13 2011 */
    
  • PARI
    {INTEGRATE(n,F)=local(G=F);for(i=1,n,G=intformal(G));G}
    {a(n)=local(A=1+x);A=sum(k=0,n,INTEGRATE(k,exp((k+1)*x+x*O(x^n))));n!*polcoeff(A,n)} \\ Paul D. Hanna, Dec 28 2013
    for(n=0,30,print1(a(n),", "))
    
  • PARI
    {a(n)=polcoeff( sum(m=0, n, m!*x^m/(1-x +x*O(x^n))^(m+1)/prod(k=1, m, 1+k*x +x*O(x^n))), n)}  /* From o.g.f. (Paul D. Hanna, Jul 20 2014) */
    for(n=0, 25, print1(a(n), ", "))
    
  • Sage
    [sum((n-j+1)^j for j in (0..n)) for n in (0..30)] # G. C. Greubel, Jun 15 2021

Formula

a(n) = A003101(n) + 1.
G.f.: Sum_{n>=0} x^n/(1 - (n+1)*x). - Paul D. Hanna, Sep 13 2011
G.f.: G(0) where G(k) = 1 + x*(2*k*x-1)/((2*k*x+x-1) - x*(2*k*x+x-1)^2/(x*(2*k*x+x-1) + (2*k*x+2*x-1)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jan 26 2013
E.g.f.: Sum_{n>=0} Integral^n exp((n+1)*x) dx^n, where Integral^n F(x) dx^n is the n-th integration of F(x) with no constant of integration. - Paul D. Hanna, Dec 28 2013
O.g.f.: Sum_{n>=0} n! * x^n/(1-x)^(n+1) / Product_{k=1..n} (1 + k*x). - Paul D. Hanna, Jul 20 2014
a(n) = A101494(n+1,0). - Vladimir Kruchinin, Apr 01 2015
a(n-1) = Sum_{k = 1..n} k^(n-k). - Gus Wiseman, Jan 08 2019
log(a(n)) ~ (1 - 1/LambertW(exp(1)*n)) * n * log(1 + n/LambertW(exp(1)*n)). - Vaclav Kotesovec, Jun 15 2021
a(n) ~ sqrt(2*Pi/(n+1 + (n+1)/w(n))) * ((n+1)/w(n))^(n+2 - (n+1)/w(n)), where w(n) = LambertW(exp(1)*(n+1)). - Vaclav Kotesovec, Jun 25 2021, after user "leonbloy", see Mathematics Stack Exchange link.

Extensions

a(23)-a(25) from Paul D. Hanna, Dec 28 2013

A287215 Number T(n,k) of set partitions of [n] such that the maximal absolute difference between the least elements of consecutive blocks equals k; triangle T(n,k), n>=0, 0<=k<=max(n-1,0), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 8, 5, 1, 1, 22, 21, 7, 1, 1, 65, 86, 39, 11, 1, 1, 209, 361, 209, 77, 19, 1, 1, 732, 1584, 1123, 493, 171, 35, 1, 1, 2780, 7315, 6153, 3124, 1293, 413, 67, 1, 1, 11377, 35635, 34723, 20019, 9320, 3709, 1059, 131, 1, 1, 49863, 183080, 202852, 130916, 66992, 30396, 11373, 2837, 259, 1
Offset: 0

Views

Author

Alois P. Heinz, May 21 2017

Keywords

Comments

The maximal absolute difference is assumed to be zero if there are fewer than two blocks.
T(n,k) is defined for all n,k >= 0. The triangle contains only the positive terms. T(n,k) = 0 if k>=n and k>0.

Examples

			T(4,0) = 1: 1234.
T(4,1) = 8: 134|2, 13|24, 14|23, 1|234, 14|2|3, 1|24|3, 1|2|34, 1|2|3|4.
T(4,2) = 5: 124|3, 12|34, 12|3|4, 13|2|4, 1|23|4.
T(4,3) = 1: 123|4.
Triangle T(n,k) begins:
  1;
  1;
  1,   1;
  1,   3,    1;
  1,   8,    5,    1;
  1,  22,   21,    7,   1;
  1,  65,   86,   39,  11,   1;
  1, 209,  361,  209,  77,  19,  1;
  1, 732, 1584, 1123, 493, 171, 35, 1;
		

Crossrefs

Row sums give A000110.
T(2n,n) gives A322884.

Programs

  • Maple
    b:= proc(n, k, m, l) option remember; `if`(n<1, 1,
         `if`(l-n>k, 0, b(n-1, k, m+1, n))+m*b(n-1, k, m, l))
        end:
    A:= (n, k)-> b(n-1, min(k, n-1), 1, n):
    T:= (n, k)-> A(n, k)-`if`(k=0, 0, A(n, k-1)):
    seq(seq(T(n, k), k=0..max(n-1, 0)), n=0..12);
  • Mathematica
    b[n_, k_, m_, l_] := b[n, k, m, l] = If[n < 1, 1, If[l - n > k, 0, b[n - 1, k, m + 1, n]] + m*b[n - 1, k, m, l]];
    A[n_, k_] := b[n - 1, Min[k, n - 1], 1, n];
    T[n_, k_] := A[n, k] - If[k == 0, 0, A[n, k - 1]];
    Table[T[n, k], {n, 0, 12}, {k, 0, Max[n - 1, 0]}] // Flatten (* Jean-François Alcover, May 19 2018, after Alois P. Heinz *)

Formula

T(n,k) = A287216(n,k) - A287216(n,k-1) for k>0, T(n,0) = 1.

A287641 Number A(n,k) of set partitions of [n] such that j is member of block b only if b = 1 or at least one of j-1, ..., j-k is member of a block >= b-1; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 5, 1, 1, 1, 2, 5, 14, 1, 1, 1, 2, 5, 15, 42, 1, 1, 1, 2, 5, 15, 51, 132, 1, 1, 1, 2, 5, 15, 52, 191, 429, 1, 1, 1, 2, 5, 15, 52, 202, 773, 1430, 1, 1, 1, 2, 5, 15, 52, 203, 861, 3336, 4862, 1, 1, 1, 2, 5, 15, 52, 203, 876, 3970, 15207, 16796, 1
Offset: 0

Views

Author

Alois P. Heinz, May 28 2017

Keywords

Examples

			A(5,0) = 1: 12345.
A(5,1) = 42 = 52 - 10 = A000110(5) - 10 counts all set partitions of [5] except: 124|3|5, 135|2|4, 13|25|4, 13|2|45, 13|2|4|5, 14|23|5, 14|2|35, 14|2|3|5, 1|24|3|5, 134|2|5.
A(5,2) = 51 = 52 - 1 = A000110(5) - 1 counts all set partitions of [5] except: 134|2|5.
Square array A(n,k) begins:
  1,   1,   1,   1,   1,   1,   1,   1, ...
  1,   1,   1,   1,   1,   1,   1,   1, ...
  1,   2,   2,   2,   2,   2,   2,   2, ...
  1,   5,   5,   5,   5,   5,   5,   5, ...
  1,  14,  15,  15,  15,  15,  15,  15, ...
  1,  42,  51,  52,  52,  52,  52,  52, ...
  1, 132, 191, 202, 203, 203, 203, 203, ...
  1, 429, 773, 861, 876, 877, 877, 877, ...
		

Crossrefs

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, 1, add(b(n-1,
          [seq(max(l[i], j), i=2..nops(l)), j]), j=1..l[1]+1))
        end:
    A:= (n, k)-> `if`(k=0, 1, b(n, [0$k])):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[0, ] = 1; b[n, l_List] := b[n, l] = Sum[b[n - 1, Append[ Table[ Max[ l[[i]], j], {i, 2, Length[l]}], j]], {j, 1, l[[1]] + 1}];
    A[n_, k_] := If[k == 0, 1, b[n, Table[0, k]]];
    Table[A[n, d - n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Apr 30 2018, after Alois P. Heinz *)

Formula

A(n,k) = Sum_{j=0..k} A287640(n,j).

A287214 Number A(n,k) of set partitions of [n] such that for each block all absolute differences between consecutive elements are <= k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 4, 1, 1, 1, 2, 5, 8, 1, 1, 1, 2, 5, 13, 16, 1, 1, 1, 2, 5, 15, 34, 32, 1, 1, 1, 2, 5, 15, 47, 89, 64, 1, 1, 1, 2, 5, 15, 52, 150, 233, 128, 1, 1, 1, 2, 5, 15, 52, 188, 481, 610, 256, 1, 1, 1, 2, 5, 15, 52, 203, 696, 1545, 1597, 512, 1
Offset: 0

Views

Author

Alois P. Heinz, May 21 2017

Keywords

Comments

The sequence of column k satisfies a linear recurrence with constant coefficients of order 2^(k-1) for k>0.

Examples

			A(4,0) = 1: 1|2|3|4.
A(4,1) = 8: 1234, 123|4, 12|34, 12|3|4, 1|234, 1|23|4, 1|2|34, 1|2|3|4.
A(4,2) = 13: 1234, 123|4, 124|3, 12|34, 12|3|4, 134|2, 13|24, 13|2|4, 1|234, 1|23|4, 1|24|3, 1|2|34, 1|2|3|4.
Square array A(n,k) begins:
  1,  1,   1,   1,   1,   1,   1,   1, ...
  1,  1,   1,   1,   1,   1,   1,   1, ...
  1,  2,   2,   2,   2,   2,   2,   2, ...
  1,  4,   5,   5,   5,   5,   5,   5, ...
  1,  8,  13,  15,  15,  15,  15,  15, ...
  1, 16,  34,  47,  52,  52,  52,  52, ...
  1, 32,  89, 150, 188, 203, 203, 203, ...
  1, 64, 233, 481, 696, 825, 877, 877, ...
		

Crossrefs

Main diagonal gives A000110.

Programs

  • Maple
    b:= proc(n, k, l) option remember; `if`(n=0, 1, b(n-1, k, map(x->
          `if`(x-n>=k, [][], x), [l[], n]))+add(b(n-1, k, sort(map(x->
          `if`(x-n>=k, [][], x), subsop(j=n, l)))), j=1..nops(l)))
        end:
    A:= (n, k)-> b(n, min(k, n-1), []):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[0, , ] = 1; b[n_, k_, l_List] := b[n, k, l] = b[n - 1, k, If[# - n >= k, Nothing, #]& /@ Append[l, n]] + Sum[b[n - 1, k, Sort[If[# - n >= k, Nothing, #]& /@ ReplacePart[l, j -> n]]], {j, 1, Length[l]}];
    A[n_, k_] := b[n, Min[k, n - 1], {}];
    Table[A[n, d - n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Apr 30 2018, after Alois P. Heinz *)

Formula

A(n,k) = Sum_{j=0..k} A287213(n,j).

A287417 Number A(n,k) of set partitions of [n] such that all absolute differences between least elements of consecutive blocks and between consecutive elements within the blocks are not larger than k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 2, 0, 1, 1, 2, 3, 0, 1, 1, 2, 5, 4, 0, 1, 1, 2, 5, 12, 5, 0, 1, 1, 2, 5, 15, 27, 6, 0, 1, 1, 2, 5, 15, 46, 58, 7, 0, 1, 1, 2, 5, 15, 52, 139, 121, 8, 0, 1, 1, 2, 5, 15, 52, 187, 410, 248, 9, 0, 1, 1, 2, 5, 15, 52, 203, 677, 1189, 503, 10, 0
Offset: 0

Views

Author

Alois P. Heinz, May 24 2017

Keywords

Examples

			A(5,3) = 46 = 52 - 6 = A000110(5) - 6 counts all set partitions of [5] except: 1234|5, 15|234, 15|23|4, 15|24|3, 15|2|34, 15|2|3|4.
Square array A(n,k) begins:
  1, 1,   1,   1,   1,   1,   1,   1, ...
  1, 1,   1,   1,   1,   1,   1,   1, ...
  0, 2,   2,   2,   2,   2,   2,   2, ...
  0, 3,   5,   5,   5,   5,   5,   5, ...
  0, 4,  12,  15,  15,  15,  15,  15, ...
  0, 5,  27,  46,  52,  52,  52,  52, ...
  0, 6,  58, 139, 187, 203, 203, 203, ...
  0, 7, 121, 410, 677, 824, 877, 877, ...
		

Crossrefs

Main diagonal gives A000110.

Programs

  • Maple
    b:= proc(n, k, l, t) option remember; `if`(n<1, 1, `if`(t-n>k, 0,
           b(n-1, k, map(x-> `if`(x-n>=k, [][], x), [l[], n]), n)) +add(
           b(n-1, k, sort(map(x-> `if`(x-n>=k, [][], x), subsop(j=n, l))),
           `if`(t-n>k, infinity, t)), j=1..nops(l)))
        end:
    A:= (n, k)-> b(n, min(k, n-1), [], n):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    b[n_, k_, l_, t_] := b[n, k, l, t] = If[n < 1, 1, If[t - n > k, 0, b[n - 1, k, If[# - n >= k, Nothing, #]& /@  Append[l, n], n]] + Sum[b[n - 1, k, Sort[If[# - n >= k, Nothing, #]& /@ ReplacePart[l, j -> n]], If[t - n > k, Infinity, t]], {j, 1, Length[l]}]];
    A[n_, k_] := b[n, Min[k, n - 1], {}, n];
    Table[A[n, d - n], {d, 0, 14}, { n, 0, d}] // Flatten (* Jean-François Alcover, May 24 2018, translated from Maple *)

Formula

A(n,k) = Sum_{j=0..k} A287416(n,j).

A287252 Number of set partitions of [n] such that all absolute differences between least elements of consecutive blocks are <= two.

Original entry on oeis.org

1, 1, 2, 5, 14, 44, 152, 571, 2317, 10096, 47013, 232944, 1223428, 6786936, 39640947, 243060305, 1560340480, 10461611439, 73094563140, 531127372268, 4006242743228, 31316162403165, 253292622192153, 2116823651781702, 18255325000268015, 162261535224570326
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Crossrefs

Column k=2 of A287216.
Cf. A000110.

Programs

  • Maple
    b:= proc(n, k, m, l) option remember; `if`(n<1, 1,
         `if`(l-n>k, 0, b(n-1, k, m+1, n))+m*b(n-1, k, m, l))
        end:
    a:= n-> b(n-1, min(2, n-1), 1, n):
    seq(a(n), n=0..30);
  • Mathematica
    b[n_, k_, m_, l_] := b[n, k, m, l] = If[n < 1, 1, If[l - n > k, 0, b[n - 1, k, m + 1, n]] + m*b[n - 1, k, m, l]];
    a[n_] := b[n - 1, Min[2, n - 1], 1, n];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 28 2018, from Maple *)

Formula

a(n) = A287216(n,2).
a(n) = A000110(n) for n <= 3.

A287253 Number of set partitions of [n] such that all absolute differences between least elements of consecutive blocks are <= three.

Original entry on oeis.org

1, 1, 2, 5, 15, 51, 191, 780, 3440, 16249, 81736, 435796, 2453100, 14529728, 90294625, 587256087, 3988153356, 28223370977, 207745253237, 1587804229045, 12581186077773, 103197641796678, 875085283793768, 7661468372063681, 69173450911547978, 643354845906697516
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Crossrefs

Column k=3 of A287216.
Cf. A000110.

Formula

a(n) = A287216(n,3).
a(n) = A000110(n) for n <= 4.

A287254 Number of set partitions of [n] such that all absolute differences between least elements of consecutive blocks are <= four.

Original entry on oeis.org

1, 1, 2, 5, 15, 52, 202, 857, 3933, 19373, 101755, 566712, 3331349, 20592862, 133439286, 903926271, 6385918342, 46950260915, 358560107124, 2839638581291, 23285101241537, 197425160416845, 1728548417051752, 15610025975013920, 145242705457704688
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Crossrefs

Column k=4 of A287216.
Cf. A000110.

Formula

a(n) = A287216(n,4).
a(n) = A000110(n) for n <= 5.

A287255 Number of set partitions of [n] such that all absolute differences between least elements of consecutive blocks are <= five.

Original entry on oeis.org

1, 1, 2, 5, 15, 52, 203, 876, 4104, 20666, 111075, 633704, 3819875, 24230302, 161175189, 1120918549, 8129696204, 61351621492, 480802257296, 3905922860317, 32839970931663, 285348575175351, 2559007785431183, 23657489230231038, 225209876301752325
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Crossrefs

Column k=5 of A287216.
Cf. A000110.

Formula

a(n) = A287216(n,5).
a(n) = A000110(n) for n <= 6.

A287256 Number of set partitions of [n] such that all absolute differences between least elements of consecutive blocks are <= six.

Original entry on oeis.org

1, 1, 2, 5, 15, 52, 203, 877, 4139, 21079, 114784, 664100, 4062241, 26164323, 176828713, 1250185783, 9221588229, 70796614497, 564525137134, 4666694339977, 39927027760582, 353023213637306, 3221255985418911, 30296436876469140, 293363448567612910
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Crossrefs

Column k=6 of A287216.
Cf. A000110.

Formula

a(n) = A287216(n,6).
a(n) = A000110(n) for n <= 7.
Showing 1-10 of 14 results. Next