login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A176305
Triangle T(n,k) = 1 -A002627(k) -A002627(n-k) +A002627(n), read by rows.
5
1, 1, 1, 1, 2, 1, 1, 7, 7, 1, 1, 31, 36, 31, 1, 1, 165, 194, 194, 165, 1, 1, 1031, 1194, 1218, 1194, 1031, 1, 1, 7423, 8452, 8610, 8610, 8452, 7423, 1, 1, 60621, 68042, 69066, 69200, 69066, 68042, 60621, 1, 1, 554249, 614868, 622284, 623284, 623284, 622284, 614868, 554249, 1
OFFSET
0,5
COMMENTS
Row sums are {1, 2, 4, 16, 100, 720, 5670, 48972, 464660, 4829372, 54711782, ...}.
Row sums s(n) appear to obey (2-n)*s(n) +(n+2)*(n-1)*s(n-2) -n*(2*n-1)*s(n-2) +n*(n-2)*s(n-3)=0. - R. J. Mathar, May 04 2013
FORMULA
T(n,k) = T(n,n-k).
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 2, 1;
1, 7, 7, 1;
1, 31, 36, 31, 1;
1, 165, 194, 194, 165, 1;
1, 1031, 1194, 1218, 1194, 1031, 1;
1, 7423, 8452, 8610, 8610, 8452, 7423, 1;
1, 60621, 68042, 69066, 69200, 69066, 68042, 60621, 1;
1, 554249, 614868, 622284, 623284, 623284, 622284, 614868, 554249, 1;
MAPLE
T:= proc(n, k) option remember;
if k=0 or k=n then 1
else 1 +floor(n!*(exp(1)-1)) -floor(k!*(exp(1)-1)) -floor((n-k)!*(exp(1)-1))
fi; end:
seq(seq(T(n, k), k=0..n), n=0..10); # G. C. Greubel, Nov 26 2019
MATHEMATICA
(* First program *)
a[n_]:= a[n] = If[n==0, 0, n*a[n-1] +1];
T[n_, k_]:= T[n, k] = 1 -(a[k] +a[n-k] -a[n]);
Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten
(* Second program *)
T[n_, k_]:= T[n, k]= If[k==0 || k==n, 1, 1 +Floor[n!*(E-1)] -Floor[k!*(E-1)] - Floor[(n-k)!*(E-1)]]; Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 26 2019 *)
PROG
(PARI) T(n, k) = if(k==0 || k==n, 1, 1 +floor(n!*(exp(1)-1)) -floor(k!*(exp(1)-1)) -floor((n-k)!*(exp(1)-1)) ); \\ G. C. Greubel, Nov 26 2019
(Magma)b:= func< n | Factorial(n)*(Exp(1)-1)>;
function T(n, k)
if k eq 0 or k eq n then return 1;
else return 1 +Floor(b(n)) -Floor(b(k)) -Floor(b(n-k));
end if; return T; end function;
[T(n, k): k in [0..n], n in [0..10]]; // G. C. Greubel, Nov 26 2019
(Sage)
@CachedFunction
def b(n): return factorial(n)*(exp(1)-1);
def T(n, k):
if (k==0 or k==n): return 1
else: return 1 +floor(b(n)) -floor(b(k)) -floor(b(n-k))
[[T(n, k) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Nov 26 2019
CROSSREFS
Sequence in context: A166345 A015110 A128596 * A139349 A168347 A120475
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Apr 14 2010
STATUS
approved