cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A118416 Triangle read by rows: T(n,k) = (2*k-1)*2^(n-1), 0 < k <= n.

Original entry on oeis.org

1, 2, 6, 4, 12, 20, 8, 24, 40, 56, 16, 48, 80, 112, 144, 32, 96, 160, 224, 288, 352, 64, 192, 320, 448, 576, 704, 832, 128, 384, 640, 896, 1152, 1408, 1664, 1920, 256, 768, 1280, 1792, 2304, 2816, 3328, 3840, 4352, 512, 1536, 2560, 3584, 4608, 5632, 6656, 7680
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 27 2006

Keywords

Comments

Row sums give A014477: Sum_{k=1..n} T(n,k) = A014477(n-1);
central terms give A118415; T(2*k-1,k) = A058962(k-1);
T(n,1) = A000079(n-1);
T(n,2) = A007283(n-1) for n > 1;
T(n,3) = A020714(n-1) for n > 2;
T(n,4) = A005009(n-1) for n > 3;
T(n,5) = A005010(n-1) for n > 4;
T(n,n-1) = A118417(n-1) for n > 1;
T(n,n) = A014480(n-1) = A118413(n,n);
A001511(T(n,k)) = A002024(n,k);
A003602(T(n,k)) = A002260(n,k).
The alternating row sums, Sum_{k=1..n} (-1)^(k+1)*T(n,k), are: (a) in odd rows, the central term, T(n,(n+1)/2) = A058962((n-1)/2); (b) in even rows, the negation of the average of the two central terms, -(T(2n,n) + T(2n,+1))/2 = -A018215(m/2). The absolute values of the alternating row sums give the plain row means, Sum_{k=1..n} T(n,k)/n; the alternating sign row means are (-2)^(n-1). - Gregory Gerard Wojnar, Feb 10 2024

Examples

			Triangle begins:
   1;
   2,   6;
   4,  12,  20;
   8,  24,  40,  56;
  16,  48,  80, 112, 144;
  32,  96, 160, 224, 288, 352;
  64, 192, 320, 448, 576, 704, 832;
		

Crossrefs

Programs

  • Haskell
    a118416 n k = a118416_tabl !! (n-1) !! (k-1)
    a118416_row 1 = [1]
    a118416_row n = (map (* 2) $ a118416_row (n-1)) ++ [a014480 (n-1)]
    a118416_tabl = map a118416_row [1..]
    -- Reinhard Zumkeller, Jan 22 2012
    
  • Maple
    A118416 := proc(n,k) 2^(n-1)*(2*k-1) ; end proc: # R. J. Mathar, Sep 04 2011
  • Mathematica
    Flatten[Table[(2k-1)2^(n-1),{n,10},{k,n}]] (* Harvey P. Dale, Aug 26 2014 *)
  • Python
    from math import isqrt
    def A118416(n): return (a:=(m:=isqrt(k:=n<<1))+(k>m*(m+1)))*(1-a)+(n<<1)-1<Chai Wah Wu, Jun 20 2025

Formula

T(n,k) = 2*T(n-1,k), 1 <= k < n; T(n,n) = A014480(n-1).