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.
%I A118416 #37 Jun 20 2025 12:41:59 %S A118416 1,2,6,4,12,20,8,24,40,56,16,48,80,112,144,32,96,160,224,288,352,64, %T A118416 192,320,448,576,704,832,128,384,640,896,1152,1408,1664,1920,256,768, %U A118416 1280,1792,2304,2816,3328,3840,4352,512,1536,2560,3584,4608,5632,6656,7680 %N A118416 Triangle read by rows: T(n,k) = (2*k-1)*2^(n-1), 0 < k <= n. %C A118416 Row sums give A014477: Sum_{k=1..n} T(n,k) = A014477(n-1); %C A118416 central terms give A118415; T(2*k-1,k) = A058962(k-1); %C A118416 T(n,1) = A000079(n-1); %C A118416 T(n,2) = A007283(n-1) for n > 1; %C A118416 T(n,3) = A020714(n-1) for n > 2; %C A118416 T(n,4) = A005009(n-1) for n > 3; %C A118416 T(n,5) = A005010(n-1) for n > 4; %C A118416 T(n,n-1) = A118417(n-1) for n > 1; %C A118416 T(n,n) = A014480(n-1) = A118413(n,n); %C A118416 A001511(T(n,k)) = A002024(n,k); %C A118416 A003602(T(n,k)) = A002260(n,k). %C A118416 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 %H A118416 Reinhard Zumkeller, <a href="/A118416/b118416.txt">Rows n = 1..100 of triangle, flattened</a> %F A118416 T(n,k) = 2*T(n-1,k), 1 <= k < n; T(n,n) = A014480(n-1). %e A118416 Triangle begins: %e A118416 1; %e A118416 2, 6; %e A118416 4, 12, 20; %e A118416 8, 24, 40, 56; %e A118416 16, 48, 80, 112, 144; %e A118416 32, 96, 160, 224, 288, 352; %e A118416 64, 192, 320, 448, 576, 704, 832; %p A118416 A118416 := proc(n,k) 2^(n-1)*(2*k-1) ; end proc: # _R. J. Mathar_, Sep 04 2011 %t A118416 Flatten[Table[(2k-1)2^(n-1),{n,10},{k,n}]] (* _Harvey P. Dale_, Aug 26 2014 *) %o A118416 (Haskell) %o A118416 a118416 n k = a118416_tabl !! (n-1) !! (k-1) %o A118416 a118416_row 1 = [1] %o A118416 a118416_row n = (map (* 2) $ a118416_row (n-1)) ++ [a014480 (n-1)] %o A118416 a118416_tabl = map a118416_row [1..] %o A118416 -- _Reinhard Zumkeller_, Jan 22 2012 %o A118416 (Python) %o A118416 from math import isqrt %o A118416 def A118416(n): return (a:=(m:=isqrt(k:=n<<1))+(k>m*(m+1)))*(1-a)+(n<<1)-1<<a-1 # _Chai Wah Wu_, Jun 20 2025 %Y A118416 Cf. A118413, A117303, A054582. %K A118416 nonn,tabl %O A118416 1,2 %A A118416 _Reinhard Zumkeller_, Apr 27 2006