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!)
A157454 Triangle read by rows: T(n, m) = min(2*m - 1, 2*(n - m) + 1). 5
1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1, 3, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 7, 5, 3, 1, 1, 3, 5, 7, 7, 5, 3, 1, 1, 3, 5, 7, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 9, 7, 5, 3, 1 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

1,5

LINKS

Reinhard Zumkeller, Rows n = 1..125 of triangle, flattened

FORMULA

T(n,m) = T(n,n-m) = 2*m-1 for 0 <= m <= n/2, otherwise 2*(n-m)+1.

a(n) = 2*A003983(n) - 1.

From Ridouane Oudra, Jul 20 2019: (Start)

a(n) = A002024(n) - A049581(n-1).

a(n) = t - abs(t^2-2n+1), where t = floor(sqrt(2n)+1/2). (End)

EXAMPLE

Triangle starts:

  1;

  1,  1;

  1,  3,  1;

  1,  3,  3,  1;

  1,  3,  5,  3,  1;

  1,  3,  5,  5,  3,  1;

  1,  3,  5,  7,  5,  3,  1;

  1,  3,  5,  7,  7,  5,  3,  1;

  1,  3,  5,  7,  9,  7,  5,  3,  1;

  1,  3,  5,  7,  9,  9,  7,  5,  3,  1;

  1,  3,  5,  7,  9, 11,  9,  7,  5,  3,  1;

  ...

MATHEMATICA

Table[Min[2*k-1, 2*(n-k)+1], {n, 1, 12}, {k, 1, n}]//Flatten (* modified by G. C. Greubel, Jun 30 2019 *)

PROG

(Haskell)

import Data.List (inits)

a157454 n k = a157454_tabl !! (n-1) !! (k-1)

a157454_row n = a157454_tabl !! (n-1)

a157454_tabl = concatMap h $ tail $ inits [1, 3 ..] where

   h xs = [xs ++ tail xs', xs ++ xs'] where xs' = reverse xs

-- Reinhard Zumkeller, Dec 15 2013

(PARI) {T(n, k) = min(2*k-1, 2*(n-k)+1)};

for(n=1, 12, for(k=1, n, print1(T(n, k), ", "))) \\ G. C. Greubel, Jun 30 2019

(MAGMA) [[Min(2*k-1, 2*(n-k)+1): k in [1..n]]: n in [1..12]]; // G. C. Greubel, Jun 30 2019

(Sage) [[min(2*k-1, 2*(n-k)+1) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jun 30 2019

(GAP) Flat(List([1..12], n-> List([1..n], k-> Minimum(2*k-1, 2*(n-k)+1) ))) # G. C. Greubel, Jun 30 2019

CROSSREFS

Cf. A003983, A005408.

Row sums are A000982(n).

Sequence in context: A132429 A046540 A123191 * A106255 A143086 A327481

Adjacent sequences:  A157451 A157452 A157453 * A157455 A157456 A157457

KEYWORD

nonn,easy,tabl

AUTHOR

Roger L. Bagula, Mar 01 2009

EXTENSIONS

Edited by the Associate Editors of the OEIS, Apr 10 2009

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 May 17 19:26 EDT 2021. Contains 343988 sequences. (Running on oeis4.)