login
A027052
Triangular array T read by rows: T(n,0) = T(n,2n) = 1 for n >= 0, T(n,1)=0 for n >= 1, T(n,2)=1 for n >= 2 and for n >= 3, T(n,k) = T(n-1,k-3) + T(n-1, k-2) + T(n-1,k-1) for 3 <= k <= 2n-1. T(n,k)=0 for k < 0 or k > 2n.
40
1, 1, 0, 1, 1, 0, 1, 2, 1, 1, 0, 1, 2, 3, 4, 1, 1, 0, 1, 2, 3, 6, 9, 8, 1, 1, 0, 1, 2, 3, 6, 11, 18, 23, 18, 1, 1, 0, 1, 2, 3, 6, 11, 20, 35, 52, 59, 42, 1, 1, 0, 1, 2, 3, 6, 11, 20, 37, 66, 107, 146, 153, 102, 1, 1, 0, 1, 2, 3, 6, 11, 20, 37, 68, 123, 210, 319, 406, 401, 256, 1
OFFSET
0,8
COMMENTS
The following sequences all have the same parity: A004737, A006590, A027052, A071028, A071797, A078358, A078446. - Jeremy Gardiner, Mar 16 2003
FORMULA
A001590(k+1) = T(n,k) if 0 <= k <= n. - Michael Somos, Jun 01 2014
EXAMPLE
Triangle T(n,k) for 0 <= k <= 2n:
1;
1, 0, 1;
1, 0, 1, 2, 1;
1, 0, 1, 2, 3, 4, 1;
1, 0, 1, 2, 3, 6, 9, 8, 1;
MAPLE
T:= proc(n, k) option remember;
if k=0 or k=2 or k=2*n then 1
elif k=1 then 0
else add(T(n-1, k-j), j=1..3)
fi
end:
seq(seq(T(n, k), k=0..2*n), n=0..10); # G. C. Greubel, Nov 05 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==2 || k==2*n, 1, If[k==1, 0, Sum[T[n-1, k-j], {j, 3}]]]; Table[T[n, k], {n, 0, 12}, {k, 0, 2*n}]//Flatten (* G. C. Greubel, Nov 05 2019 *)
PROG
(PARI) {T(n, k) = if(k==0 || k==2 || k==2*n, 1, if(k==1, 0, sum(j=1, 3, T(n-1, k-j)) ))};
for(n=0, 10, for(k=0, 2*n, print1(T(n, k), ", "))) \\ G. C. Greubel, Nov 05 2019
(Sage)
@CachedFunction
def T(n, k):
if (k==0 or k==2 or k==2*n): return 1
elif (k==1): return 0
else: return sum(T(n-1, k-j) for j in (1..3))
[[T(n, k) for k in (0..2*n)] for n in (0..10)] # G. C. Greubel, Nov 05 2019
(GAP)
T:= function(n, k)
if k=0 or k=2 or k=2*n then return 1;
elif k=1 then return 0;
else return Sum([1..3], j-> T(n-1, k-j) );
fi;
end;
Flat(List([0..10], n-> List([0..2*n], k-> T(n, k) ))); # G. C. Greubel, Nov 05 2019
CROSSREFS
Cf. A001590, a tribonacci sequence.
Cf. A160999 (row sums), A005408 (row lengths).
Diagonals T(n, n+c): A027053 (c=2), A027054 (c=3), A027055 (c=4).
Diagonals T(n, 2n-c): A027056 (c=1), A027058 (c=2), A027059 (c=3), A027060 (c=4), A027061(c=5), A027062 (c=6), A027063 (c=7), A027064 (c=8), A027065 (c=9), A027066 (c=10).
Other related sequences: A027057, A027071.
Other arrays of this type: A027023, A027082, A027113.
Sequence in context: A348422 A294509 A059571 * A322508 A194438 A144409
KEYWORD
nonn,tabf
EXTENSIONS
Offset and keyword:tabl corrected by R. J. Mathar, Jun 01 2009
STATUS
approved