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!)
A157522 Triangle T(n, k) = f(n, k) + f(n, n-k) - 1, where f(n, k) = k if k <= floor(n/4), floor(n/2) - k if floor(n/4) < k <= floor(n/2), k - floor(n/2) if floor(n/2) < k <= floor(3*n/4), otherwise n-k, read by rows. 2

%I #9 Jan 23 2022 07:27:32

%S 1,1,1,1,1,1,1,2,2,1,1,3,1,3,1,1,3,2,2,3,1,1,3,3,1,3,3,1,1,3,4,2,2,4,

%T 3,1,1,3,5,3,1,3,5,3,1,1,3,5,4,2,2,4,5,3,1,1,3,5,5,3,1,3,5,5,3,1,1,3,

%U 5,6,4,2,2,4,6,5,3,1,1,3,5,7,5,3,1,3,5,7,5,3,1,1,3,5,7,6,4,2,2,4,6,7,5,3,1

%N Triangle T(n, k) = f(n, k) + f(n, n-k) - 1, where f(n, k) = k if k <= floor(n/4), floor(n/2) - k if floor(n/4) < k <= floor(n/2), k - floor(n/2) if floor(n/2) < k <= floor(3*n/4), otherwise n-k, read by rows.

%H G. C. Greubel, <a href="/A157522/b157522.txt">Rows n = 0..50 of the triangle, flattened</a>

%F T(n, k) = f(n, k) + f(n, n-k) - 1, where f(n, k) = k if k <= floor(n/4), floor(n/2) - k if floor(n/4) < k <= floor(n/2), k - floor(n/2) if floor(n/2) < k <= floor(3*n/4), otherwise n-k.

%F From _G. C. Greubel_, Jan 22 2022: (Start)

%F T(n, n-k) = T(n, k).

%F T(2*n, n) = 1.

%F T(2*n+1, n) = A040000(n).

%F Sum_{k=0..n} T(n, k) = A302488(n). (End)

%e Triangle begins as:

%e 1;

%e 1, 1;

%e 1, 1, 1;

%e 1, 2, 2, 1;

%e 1, 3, 1, 3, 1;

%e 1, 3, 2, 2, 3, 1;

%e 1, 3, 3, 1, 3, 3, 1;

%e 1, 3, 4, 2, 2, 4, 3, 1;

%e 1, 3, 5, 3, 1, 3, 5, 3, 1;

%e 1, 3, 5, 4, 2, 2, 4, 5, 3, 1;

%e 1, 3, 5, 5, 3, 1, 3, 5, 5, 3, 1;

%t f[n_, k_]= 1 +If[k<=Floor[n/4], k, If[Floor[n/4]<k<=Floor[n/2], Floor[n/2]-k, If[Floor[n/2]<k<=Floor[3*n/4], k-Floor[n/2], n-k]]];

%t T[n_, k_]:= f[n,k] +f[n,n-k] -1;

%t Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* modified by _G. C. Greubel_, Jan 22 2022 *)

%o (Sage)

%o def f(n, k):

%o if (k <= (n//4)): return k+1

%o elif ((n//4) < k <= (n//2)): return (n//2)-k+1

%o elif ((n//2) < k <= (3*n//4)): return k+1-(n//2)

%o else: return n-k+1

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

%o flatten([[T(n,k) for k in (0..n)] for n in (0..15)]) # _G. C. Greubel_, Jan 22 2022

%Y Cf. A157523.

%K nonn,tabl

%O 0,8

%A _Roger L. Bagula_, Mar 02 2009

%E Edited by _N. J. A. Sloane_, Mar 05 2009

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 19 02:45 EDT 2024. Contains 371782 sequences. (Running on oeis4.)