login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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
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, 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, 11, 56, 177, 398, 440, 267, 131, 46, 10, 1, 1, 12, 67, 233 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

T(n+2,n) = A134869(n+1). - Philippe Deléham, Feb 01 2014

LINKS

G. C. Greubel, Rows n = 0..99 of triangle, flattened

Rob Arthan, Comments on A026674, A026725, A026670

FORMULA

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.

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."

EXAMPLE

Triangle begins:

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  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 11 56 177 398  440 267 131  46 10  1

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

... - Philippe Deléham, Feb 01 2014

MAPLE

A026725 := proc(n, k)

    option remember;

    if n < 0 or k < 0 then

        0;

    elif k=0 or k=n then

        1;

    elif 2*k = n-1 then

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

   else

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

    end if;

end proc: # R. J. Mathar, Oct 21 2019

MATHEMATICA

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]]];

Table[T[n, k], {n, 0, 14}, {k, 0, n}]//Flatten (* G. C. Greubel, Jul 16 2019 *)

PROG

(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) ));

for(n=0, 11, for(k=0, n, print1(T(n, k), ", "))) \\ G. C. Greubel, Jul 16 2019

(Sage)

@CachedFunction

def T(n, k):

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

    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)

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

[[T(n, k) for k in (0..n)] for n in (0..14)] # G. C. Greubel, Jul 16 2019

(GAP)

T:= function(n, k)

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

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

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

    fi;

  end;

Flat(List([0..14], n-> List([0..n], k-> T(n, k) ))); # G. C. Greubel, Jul 16 2019

CROSSREFS

Cf. A026674.

Sequence in context: A323182 A229118 A320796 * A026758 A130523 A034363

Adjacent sequences:  A026722 A026723 A026724 * A026726 A026727 A026728

KEYWORD

nonn,tabl

AUTHOR

Clark Kimberling

EXTENSIONS

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

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 26 13:34 EDT 2021. Contains 347668 sequences. (Running on oeis4.)