login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A026725 Triangular array, T, read by rows: T(n,0) = T(n,n) = 1. For n >= 2 and 1<=k<=n-1, T(n,k) = T(n-1,k-1) + T(n-2,k-1) + T(n-1,k) if n is odd and k=n/2, otherwise T(n,k) = T(n-1,k-1) + T(n-1,k). 26

%I #39 Oct 27 2019 05:18:25

%S 1,1,1,1,2,1,1,4,3,1,1,5,7,4,1,1,6,16,11,5,1,1,7,22,27,16,6,1,1,8,29,

%T 65,43,22,7,1,1,9,37,94,108,65,29,8,1,1,10,46,131,267,173,94,37,9,1,1,

%U 11,56,177,398,440,267,131,46,10,1,1,12,67,233

%N Triangular array, T, read by rows: T(n,0) = T(n,n) = 1. For n >= 2 and 1<=k<=n-1, T(n,k) = T(n-1,k-1) + T(n-2,k-1) + T(n-1,k) if n is odd and k=n/2, otherwise T(n,k) = T(n-1,k-1) + T(n-1,k).

%C T(n+2,n) = A134869(n+1). - _Philippe Deléham_, Feb 01 2014

%H G. C. Greubel, <a href="/A026725/b026725.txt">Rows n = 0..99 of triangle, flattened</a>

%H Rob Arthan, <a href="/A026674/a026674.txt">Comments on A026674, A026725, A026670</a>

%F T(n, k) = number of paths from (0, 0) to (n-k, k) in directed graph having vertices (i, j) and edges (i, j)-to-(i+1, j) and (i, j)-to-(i, j+1) for i, j >= 0 and edges (i, i+1)-to-(i+1, i+2) for i >= 0.

%F Comment from _Rick L. Shepherd_, Aug 05 2002: Probably this should be changed to "and edges (i+1, i)-to-(i+2, i+1) for i >= 0."

%e Triangle begins:

%e 1

%e 1 1

%e 1 2 1

%e 1 4 3 1

%e 1 5 7 4 1

%e 1 6 16 11 5 1

%e 1 7 22 27 16 6 1

%e 1 8 29 65 43 22 7 1

%e 1 9 37 94 108 65 29 8 1

%e 1 10 46 131 267 173 94 37 9 1

%e 1 11 56 177 398 440 267 131 46 10 1

%e 1 12 67 233 575 1105 707 398 177 56 11 1

%e ... - _Philippe Deléham_, Feb 01 2014

%p A026725 := proc(n,k)

%p option remember;

%p if n < 0 or k < 0 then

%p 0;

%p elif k=0 or k=n then

%p 1;

%p elif 2*k = n-1 then

%p procname(n-1,k-1)+procname(n-2,k-1)+procname(n-1,k) ;

%p else

%p procname(n-1,k-1)+procname(n-1,k) ;

%p end if;

%p end proc: # _R. J. Mathar_, Oct 21 2019

%t T[n_, k_]:= T[n, k]= If[k==0||k==n, 1, If[OddQ[n] && k==(n-1)/2, T[n-1, k -1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k]]];

%t Table[T[n, k], {n,0,14}, {k,0,n}]//Flatten (* _G. C. Greubel_, Jul 16 2019 *)

%o (PARI) T(n,k) = if(k==n || k==0, 1, if(2*k==n-1, T(n-1, k-1) + T(n-2, k-1) + T(n-1, k), T(n-1, k-1) + T(n-1, k) ));

%o for(n=0,11, for(k=0,n, print1(T(n,k), ", "))) \\ _G. C. Greubel_, Jul 16 2019

%o (Sage)

%o @CachedFunction

%o def T(n, k):

%o if (k==0 or k==n): return 1

%o elif (mod(n,2)==0 and k==(n-1)/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)

%o else: return T(n-1, k-1) + T(n-1, k)

%o [[T(n, k) for k in (0..n)] for n in (0..14)] # _G. C. Greubel_, Jul 16 2019

%o (GAP)

%o T:= function(n,k)

%o if k=0 or k=n then return 1;

%o elif 2*k=n-1 then return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k);

%o else return T(n-1, k-1) + T(n-1, k);

%o fi;

%o end;

%o Flat(List([0..14], n-> List([0..n], k-> T(n,k) ))); # _G. C. Greubel_, Jul 16 2019

%Y Cf. A026674.

%K nonn,tabl

%O 0,5

%A _Clark Kimberling_

%E Title and offset corrected by _G. C. Greubel_, Jul 16 2019, again by _R. J. Mathar_, Oct 21 2019, again by _Sean A. Irvine_, Oct 25 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 22 21:44 EDT 2024. Contains 371906 sequences. (Running on oeis4.)