Search: seq:1,0,1,1,1,1,2,2,2,1
|
|
|
|
1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 5, 6, 9, 1, 4, 10, 16, 24, 44, 1, 5, 17, 38, 65, 120, 265, 1, 6, 26, 78, 168, 326, 720, 1854, 1, 7, 37, 142, 393, 872, 1957, 5040, 14833, 1, 8, 50, 236, 824, 2208, 5296, 13700, 40320, 133496, 1, 9, 65, 366, 1569, 5144, 13977, 37200, 109601, 362880, 1334961
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,8
|
|
COMMENTS
|
Can be extended to columns with negative indices k<0 via T(n,k) = A292977(n,-k). - Max Alekseyev, Mar 06 2018
|
|
LINKS
|
|
|
FORMULA
|
For n > 0, k >= -1, T(n,k) is the permanent of the n X n matrix with k+1 on the diagonal and 1 elsewhere.
T(0,k) = 1.
T(n,k) = Sum_{j>=0} A008290(n,j) * (k+1)^j.
T(n,k) = n*T(n-1, k) + k^n .
T(n,k) = n! * Sum_{j=0..n} k^j/j!.
E.g.f. for k-th column: exp(k*x)/(1-x).
Assuming n >= 0, k >= 0: T(n, k) = exp(k-1)*Gamma(n+1, k-1). - Peter Luschny, Dec 24 2021
|
|
EXAMPLE
|
n\k -1 0 1 2 3 4 5 6 ...
----------------------------------------------
0 | 1, 1, 1, 1, 1, 1, 1, 1, ...
1 | 0, 1, 2, 3, 4, 5, 6, 7, ...
2 | 1, 2, 5, 10, 17, 26, 37, 50, ...
3 | 2, 6, 16, 38, 78, 152, 236, 366, ...
4 | 9, 24, 65, 168, 393, 824, 1569, 2760, ...
...
|
|
MATHEMATICA
|
(* Assuming offset (0, 0): *)
T[n_, k_] := Exp[k - 1] Gamma[n + 1, k - 1];
Table[T[k, n - k], {n, 0, 10}, {k, 0, n}] // Flatten (* Peter Luschny, Dec 24 2021 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Edited and changed offset for k to -1 by Max Alekseyev, Mar 08 2018
|
|
STATUS
|
approved
|
|
|
|
|
A352682
|
|
Array read by ascending antidiagonals. A(n, k) = (n-1)*Gould(k-1) + Bell(k) for n >= 0 and k >= 1, A(n, 0) = 1.
|
|
+30
6
|
|
|
1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 3, 5, 6, 1, 4, 4, 8, 15, 21, 1, 5, 5, 11, 24, 52, 82, 1, 6, 6, 14, 33, 83, 203, 354, 1, 7, 7, 17, 42, 114, 324, 877, 1671, 1, 8, 8, 20, 51, 145, 445, 1400, 4140, 8536, 1, 9, 9, 23, 60, 176, 566, 1923, 6609, 21147, 46814
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,8
|
|
COMMENTS
|
The array defines a family of Bell-like sequences. The case n = 1 are the Bell numbers A000110, case n = 0 is A032347 and case n = 2 is A038561. The n-th sequence r(k) = T(n, k) is defined for k >= 0 by the recurrence r(k) = Sum_{j=0..k-1} binomial(k-1, j)*r(j) with r(0) = 1 and r(1) = n.
|
|
LINKS
|
|
|
FORMULA
|
Given a list T let PS(T) denote the list of partial sums of T. Given two list S and T let [S, T] denote the concatenation of the lists. Further let P[end] denote the last element of the list P. Row n of the array with length k can be computed by the following procedure:
A = [n], P = [1], R = [1];
Repeat k-1 times: R = [R, A], P = PS([A, P]), A = [P[end]];
Return R.
|
|
EXAMPLE
|
Array starts:
n\k 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...
---------------------------------------------------------
[0] 1, 0, 1, 2, 6, 21, 82, 354, 1671, 8536, ... A032347
[1] 1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, ... A000110
[2] 1, 2, 3, 8, 24, 83, 324, 1400, 6609, 33758, ... A038561
[3] 1, 3, 4, 11, 33, 114, 445, 1923, 9078, 46369, ... A038559
[4] 1, 4, 5, 14, 42, 145, 566, 2446, 11547, 58980, ... A352683
[5] 1, 5, 6, 17, 51, 176, 687, 2969, 14016, 71591, ...
[6] 1, 6, 7, 20, 60, 207, 808, 3492, 16485, 84202, ...
[7] 1, 7, 8, 23, 69, 238, 929, 4015, 18954, 96813, ...
[8] 1, 8, 9, 26, 78, 269, 1050, 4538, 21423, 109424, ...
[9] 1, 9, 10, 29, 87, 300, 1171, 5061, 23892, 122035, ...
|
|
MAPLE
|
alias(PS = ListTools:-PartialSums):
BellRow := proc(n, len) local a, k, P, T;
a := n; P := [1]; T := [1];
for k from 1 to len-1 do
T := [op(T), a]; P := PS([a, op(P)]); a := P[-1] od;
T end: seq(lprint(BellRow(n, 10)), n = 0..9);
|
|
MATHEMATICA
|
nmax = 10;
BellRow[n_, len_] := Module[{a, k, P, T}, a = n; P = {1}; T = {1};
For[k = 1, k <= len - 1, k++,
T = Append[T, a]; P = Accumulate[Join[{a}, P]]; a = P[[-1]]];
T];
rows = Table[BellRow[n, nmax + 1], {n, 0, nmax}];
A[n_, k_] := rows[[n + 1, k + 1]];
|
|
PROG
|
(Julia)
function BellRow(m, len)
a = m; P = BigInt[1]; T = BigInt[1]
for n in 1:len
T = vcat(T, a)
P = cumsum(vcat(a, P))
a = P[end]
end
T end
for n in 0:9 BellRow(n, 9) |> println end
|
|
CROSSREFS
|
Compare A352680 for a similar array based on the Catalan numbers.
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A372014
|
|
T(n,k) is the total number of levels in all Motzkin paths of length n containing exactly k path nodes; triangle T(n,k), n>=0, 1<=k<=n+1, read by rows.
|
|
+30
5
|
|
|
1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 4, 6, 4, 3, 1, 8, 14, 12, 7, 4, 1, 18, 32, 33, 21, 11, 5, 1, 44, 74, 84, 64, 34, 16, 6, 1, 113, 180, 208, 181, 111, 52, 22, 7, 1, 296, 457, 520, 485, 344, 179, 76, 29, 8, 1, 782, 1195, 1334, 1273, 1000, 599, 274, 107, 37, 9, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,7
|
|
COMMENTS
|
A Motzkin path of length n has n+1 nodes.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
In the A001006(3) = 4 Motzkin paths of length 3 there are 2 levels with 1 node, 2 levels with 2 nodes, 2 levels with 3 nodes, and 1 level with 4 nodes.
2 _ 1 1
2 / \ 3 /\_ 3 _/\ 4 ___ .
So row 3 is [2, 2, 2, 1].
Triangle T(n,k) begins:
1;
0, 1;
1, 1, 1;
2, 2, 2, 1;
4, 6, 4, 3, 1;
8, 14, 12, 7, 4, 1;
18, 32, 33, 21, 11, 5, 1;
44, 74, 84, 64, 34, 16, 6, 1;
113, 180, 208, 181, 111, 52, 22, 7, 1;
296, 457, 520, 485, 344, 179, 76, 29, 8, 1;
782, 1195, 1334, 1273, 1000, 599, 274, 107, 37, 9, 1;
...
|
|
MAPLE
|
g:= proc(x, y, p) (h-> `if`(x=0, add(z^coeff(h, z, i)
, i=0..degree(h)), b(x, y, h)))(p+z^y) end:
b:= proc(x, y, p) option remember; `if`(y+2<=x, g(x-1, y+1, p), 0)
+`if`(y+1<=x, g(x-1, y, p), 0)+`if`(y>0, g(x-1, y-1, p), 0)
end:
T:= n-> (p-> seq(coeff(p, z, i), i=1..n+1))(g(n, 0$2)):
seq(T(n), n=0..10);
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A194821
|
|
a(n) = 1+floor(sum{<((-1)^k)*k*sqrt(2)> : 1<=k<=n}), where < > = fractional part.
|
|
+30
4
|
|
|
0, 1, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 1, 2, 2, 2, 2, 3, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,6
|
|
COMMENTS
|
Does 0 occur infinitely many times? Is the sequence unbounded?
|
|
LINKS
|
|
|
MATHEMATICA
|
r = Sqrt[2]; p[x_] := FractionalPart[x];
f[n_] := 1 + Floor[Sum[p[k*r] (-1)^k, {k, 1, n}]]
Table[f[n], {n, 1, 100}] (* A194821 *)
|
|
PROG
|
(PARI) for(n=1, 50, print1(1 + floor(sum(k=1, n, (-1)^k*frac(k*sqrt(2))), ", ")) \\ G. C. Greubel, Apr 02 2018
(Magma) [1 + Floor((&+[(-1)^k*(k*Sqrt(2) - Floor(k*Sqrt(2))) :k in [1..n]])) : n in [1..50]]; // G. C. Greubel, Apr 02 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A264051
|
|
Triangle read by rows: T(n,k) (n>=0, 0<=k<=A264078(n)) is the number of integer partitions of n having k standard Young tableaux such that no entries i and i+1 appear in the same row.
|
|
+30
3
|
|
|
0, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 2, 3, 0, 2, 4, 2, 1, 1, 1, 1, 1, 4, 3, 1, 0, 0, 2, 2, 0, 1, 0, 1, 0, 0, 0, 1, 7, 2, 0, 0, 1, 0, 3, 0, 1, 0, 2, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 7, 3, 1, 2, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,8
|
|
COMMENTS
|
Column k=0 gives A025065(n-2) for n>=2.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
Triangle begins:
0,1,
0,1,
1,1,
1,2,
2,2,1,
2,3,0,2,
4,2,1,1,1,1,1,
4,3,1,0,0,2,2,0,1,0,1,0,0,0,1,
7,2,0,0,1,0,3,0,1,0,2,1,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,
...
|
|
MAPLE
|
h:= proc(l, j) option remember; `if`(l=[], 1,
`if`(l[1]=0, h(subsop(1=[][], l), j-1), add(
`if`(i<>j and l[i]>0 and (i=1 or l[i]>l[i-1]),
h(subsop(i=l[i]-1, l), i), 0), i=1..nops(l))))
end:
g:= proc(n, i, l) `if`(n=0 or i=1, x^h([1$n, l[]], 0),
`if`(i<1, 0, g(n, i-1, l)+ `if`(i>n, 0,
g(n-i, i, [i, l[]]))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(g(n$2, [])):
|
|
MATHEMATICA
|
h[l_, j_] := h[l, j] = If[l == {}, 1, If[l[[1]] == 0, h[ReplacePart[l, 1 -> Sequence[]], j - 1], Sum[If[i != j && l[[i]] > 0 && (i == 1 || l[[i]] > l[[i - 1]]), h[ReplacePart[l, i -> l[[i]] - 1], i], 0], {i, 1, Length[l]} ]]]; g[n_, i_, l_] := If[n == 0 || i == 1, x^h[Join[Array[1 &, n], l], 0], If[i < 1, 0, g[n, i - 1, l] + If[i > n, 0, g[n - i, i, Join[{i}, l]]] ]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][g[n, n, {}]]; Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Jan 22 2016, after Alois P. Heinz *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,tabf
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A356997
|
|
a(n) = b(n) - b(n - b(n - b(n))) for n >= 2, where b(n) = A356988(n).
|
|
+30
2
|
|
|
0, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 3, 3, 3, 3, 3, 2, 2, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 4, 3, 3, 3, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 6, 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 11, 10, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,9
|
|
COMMENTS
|
The line graph of the sequence consists of a series of local plateaus and local troughs joined at each end by lines of slope 1 and slope -1. More precisely, for k >= 3 the graph of the sequence consists of
local plateaus: on the integer interval [2*F(k), 2*F(k) + 2*F(k-3)] the sequence has the constant value F(k-2)
descent to a trough: on the integer interval [2*F(k) + 2*F(k-3), F(k+2)] the line graph of the sequence has slope -1
local troughs: on the integer interval [F(k+2), F(k+2) + F(k-3)] the sequence has the constant value F(k-3)
ascent to a plateau: on the integer interval [F(k+2) + F(k-3), 2*F(k+1)] the line graph of the sequence has slope 1.
|
|
LINKS
|
|
|
FORMULA
|
a(n+1) - a(n) = 1, 0 or -1.
For k >= 5, a(F(k) + j) = F(k-5) for 0 <= j <= F(k-5) (troughs).
For k >= 4, a(2*F(k) + j) = F(k-2) for 0 <= j <= 2*F(k-3) (plateaus).
|
|
EXAMPLE
|
The sequence is arranged to show the local plateaus (P) and the local troughs (T):
0,
1,
1,
T 0,
P 1, 1, 1
1,
P 2, 2, 2,
T 1,1,
2,
P 3, 3, 3, 3, 3,
T 2, 2, 2,
3,
4,
P 5, 5, 5, 5, 5, 5, 5,
4,
T 3, 3, 3, 3,
4,
5,
6,
7,
P 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
7,
6,
T 5, 5, 5, 5, 5, 5,
6,
7,
8,
9,
10,
11,
12,
P 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
12,
11,
10,
9,
T 8, 8, 8, 8, 8, 8, 8, 8, 8,
9,
10,
11,
...
|
|
MAPLE
|
b := proc(n) option remember; if n = 1 then 1 else n - b(b(n - b(b(b(n-1))))) end if; end proc:
seq( b(n) - b(n - b(n - b(n))), n = 2
..100);
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A124369
|
|
Riordan array (1/((1-x-x^2)(1+x+x^2)),x(1+x)/((1-x-x^2)(1+x+x^2))).
|
|
+30
1
|
|
|
1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 2, 6, 4, 3, 1, 4, 9, 12, 7, 4, 1, 7, 17, 24, 21, 11, 5, 1, 10, 34, 48, 50, 34, 16, 6, 1, 17, 58, 103, 110, 91, 52, 22, 7, 1, 28, 104, 200, 250, 220, 152, 76, 29, 8, 1, 44, 188, 385, 534, 530, 400, 239, 107, 37, 9, 1
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,7
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
Number triangle T(n,k)=sum{j=0..n, C(j,n-j)*C((j+k)/2,(j-k)/2)*(1+(-1)^(j-k))/2};
T(n,k) = T(n-1,k-1) + T(n-2,k) + T(n-2,k-1) + 2*T(n-3,k) + T(n-4,k), T(0,0) = 1, T(n,k) = 0 if k<0 or if k>n. - Philippe Deléham, Jan 22 2014
|
|
EXAMPLE
|
Triangle begins
1,
0, 1,
1, 1, 1,
2, 2, 2, 1,
2, 6, 4, 3, 1,
4, 9, 12, 7, 4, 1,
7, 17, 24, 21, 11, 5, 1,
10, 34, 48, 50, 34, 16, 6, 1,
17, 58, 103, 110, 91, 52, 22, 7, 1
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A105241
|
|
Vector triangular array of Fibonacci tensor Markov.
|
|
+30
0
|
|
|
0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 1, 1, 1, 2, 2, 2, 1, 3, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 2, 2, 2, 4, 3, 3, 1, 4, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,16
|
|
COMMENTS
|
This is the triangle form from {6,2,2}. T[n,k,j] levels j: {0, 1, 1, 1} {0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2} {0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3} {0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 1, 1, 1, 2, 2, 2, 1, 3, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 2, 2, 2, 4, 3, 3, 1, 4}
|
|
LINKS
|
|
|
FORMULA
|
v[n]=M.v[n-1] M={M1, M2} M1={{0, 1}, {1, 0}} M2={{0, 1}, {1, 1}} Selective flattening and expression to get a vector triangle representation =a[n]
|
|
MATHEMATICA
|
v[1] = {{0, 1}, {1, 1}} M = {{{0, 1}, {1, 1}}, {{0, 1}, {1, 1}}} v[n_] := v[n] = M.v[n - 1] a = Table[v[n], {n, 1, 6}] Dimensions[a aa = Table[Flatten[Table[Table[a[[n, j]], {j, 1, 2}], {n, 1, m}]], {m, 1, 6}] aout= Flatten[aa]
|
|
KEYWORD
|
nonn,uned,obsc
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
|
|
0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 1, 1, 1, 2, 2, 2, 1, 3, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 2, 2, 2, 4, 3, 3, 1, 4, 1, 1, 1, 2, 2, 2, 1, 3, 2, 2, 2, 4, 3, 3, 1, 4, 1, 1, 1, 2, 2, 2, 1, 3, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 2, 2, 2, 4, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,12
|
|
LINKS
|
|
|
MATHEMATICA
|
v[1] = {{0, 1}, {1, 1}}
M = {{{0, 1}, {1, 0}}, {{0, 1}, {1, 1}}}
v[n_] := v[n] = M.v[n - 1]
a = Table[v[n], {n, 1, 6}]
aa = Flatten[a]
Length[aa]
|
|
KEYWORD
|
nonn,uned,obsc,less
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
Search completed in 0.009 seconds
|