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.

Showing 1-8 of 8 results.

A132111 Triangle read by rows: T(n,k) = n^2 + k*n + k^2, 0 <= k <= n.

Original entry on oeis.org

0, 1, 3, 4, 7, 12, 9, 13, 19, 27, 16, 21, 28, 37, 48, 25, 31, 39, 49, 61, 75, 36, 43, 52, 63, 76, 91, 108, 49, 57, 67, 79, 93, 109, 127, 147, 64, 73, 84, 97, 112, 129, 148, 169, 192, 81, 91, 103, 117, 133, 151, 171, 193, 217, 243, 100, 111, 124, 139, 156, 175, 196, 219
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 10 2007

Keywords

Comments

Permutation of A003136, the Loeschian numbers. [This is false - some terms are repeated, the first being 49. - Joerg Arndt, Dec 18 2015]
Row sums give A132112.
Central terms give A033582.
T(n,k+1) = T(n,k) + n + 2*k + 1;
T(n+1,k) = T(n,k) + 2*n + k + 1;
T(n+1,k+1) = T(n,k) + 3*(n+k+1);
T(n,0) = A000290(n);
T(n,1) = A002061(n+1) for n>0;
T(n,2) = A117950(n+1) for n>1;
T(n,n-2) = A056107(n-1) for n>1;
T(n,n-1) = A003215(n-1) for n>0;
T(n,n) = A033428(n).
T(n,k) is the norm N(alpha) of the integer alpha = n*1 - k*omega, where omega = exp(2*Pi*i/3) = (-1 + i*sqrt(3))/2 in the imaginary quadratic number field Q(sqrt(-3)): N = |alpha|^2 = (n + k/2)^2 + (3/4)*k^2 = n^2 + n*k + k^2 = T(n,k), with n >= 0, and k <= n. See also triangle A073254 for T(n,-k). - Wolfdieter Lang, Jun 13 2021

Examples

			From _Philippe Deléham_, Apr 16 2014: (Start)
Triangle begins:
   0;
   1,  3;
   4,  7,  12;
   9, 13,  19,  27;
  16, 21,  28,  37,  48;
  25, 31,  39,  49,  61,  75;
  36, 43,  52,  63,  76,  91, 108;
  49, 57,  67,  79,  93, 109, 127, 147;
  64, 73,  84,  97, 112, 129, 148, 169, 192;
  81, 91, 103, 117, 133, 151, 171, 193, 217, 243;
  ...
(End)
		

Crossrefs

Cf. A073254.

Programs

  • Mathematica
    Flatten[Table[n^2+k*n+k^2,{n,0,10},{k,0,n}]] (* Harvey P. Dale, Jun 10 2013 *)

A198063 Triangle read by rows (n >= 0, 0 <= k <= n, m = 3); T(n,k) = Sum{j=0..m} Sum{i=0..m} (-1)^(j+i)*C(i,j)*n^j*k^(m-j).

Original entry on oeis.org

0, 1, 1, 8, 4, 8, 27, 15, 15, 27, 64, 40, 32, 40, 64, 125, 85, 65, 65, 85, 125, 216, 156, 120, 108, 120, 156, 216, 343, 259, 203, 175, 175, 203, 259, 343, 512, 400, 320, 272, 256, 272, 320, 400, 512, 729, 585, 477, 405, 369, 369, 405, 477, 585, 729
Offset: 0

Views

Author

Peter Luschny, Oct 26 2011

Keywords

Comments

Read as an infinite symmetric square array, this is the table A(n,k)=(n+k)(n^2+k^2), cf. A321500 for the triangle with k <= n. - M. F. Hasler, Nov 22 2018

Examples

			[0]                   0
[1]                  1, 1
[2]                8, 4, 8
[3]             27, 15, 15, 27
[4]           64, 40, 32, 40, 64
[5]        125, 85, 65, 65, 85, 125
[6]   216, 156, 120, 108, 120, 156, 216
[7] 343, 259, 203, 175, 175, 203, 259, 343
From _M. F. Hasler_, Nov 22 2018: (Start)
Can also be seen as the square array A(n,k)=(n+k)*(n^2 + k^2) read by antidiagonals:
n | k: 0   1   2   3 ...
--+----------------------
0 |    0   1   8  27 ...
1 |    1   4  15  40 ...
2 |    8  15  32  65 ...
3 |   27  40  65 108 ...
...      ...     ...
(End)
		

Crossrefs

Programs

  • Magma
    [[2*k^2*n-2*k*n^2+n^3: k in [0..n]]: n in [0..12]]; // G. C. Greubel, Nov 23 2018
    
  • Maple
    A198063 := (n,k) -> 2*k^2*n-2*k*n^2+n^3:
  • Mathematica
    t[n_, k_] := 2 k^2*n - 2 k*n^2 + n^3; Table[t[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Amiram Eldar, Nov 22 2018 *)
  • PARI
    A198063(n,k)=2*k^2*n-2*k*n^2+n^3 \\ See also A321500. - M. F. Hasler, Nov 22 2018
    
  • Sage
    [[ 2*k^2*n-2*k*n^2+n^3 for k in range(n+1)] for n in range(12)] # G. C. Greubel, Nov 23 2018

Formula

T(n,k) = 2*k^2*n - 2*k*n^2 + n^3.
T(n,0) = T(n,n) = n^m = n^3 = A000578(n).
T(2*n,n) = (m+1)n^m = 4*n^3 = A033430(n).
T(2*n+1,n+1) = (n+1)^(m+1) - n^(m+1) = (n+1)^4 - n^4 = A005917(n).
Sum{k=0..n} T(n,k) = (2*n^4 + 3*n^3 + n^2)/3 = A098077(n).
T(n+1,k+1)*C(n,k)^4/(k+1)^3 = A197653(n,k).

A194595 Triangle by rows T(n,k), showing the number of meanders with length (n+1)*3 and containing (k+1)*3 L's and (n-k)*3 R's, where L's and R's denote arcs of equal length and a central angle of 120 degrees which are positively or negatively oriented.

Original entry on oeis.org

1, 3, 1, 7, 14, 1, 13, 81, 39, 1, 21, 304, 456, 84, 1, 31, 875, 3000, 1750, 155, 1, 43, 2106, 13875, 18500, 5265, 258, 1, 57, 4459, 50421, 128625, 84035, 13377, 399, 1, 73, 8576, 153664, 669536, 836920, 307328, 30016, 584, 1, 91, 15309, 409536, 2815344, 6001128, 4223016, 955584, 61236, 819, 1
Offset: 0

Views

Author

Susanne Wienand, Oct 10 2011

Keywords

Comments

Definition of a meander:
A binary curve C is a triple (m, S, dir) such that
(a) S is a list with values in {L,R} which starts with an L,
(b) dir is a list of m different values, each value of S being allocated
a value of dir,
(c) consecutive L's increment the index of dir,
(d) consecutive R's decrement the index of dir,
(e) the integer m > 0 divides the length of S and
(f) C is a meander if each value of dir occurs length(S)/m times.
For this sequence, m = 3.
The values in the triangle are proved by brute force for 0 <= n <= 11. The formulas are not yet proved in general. - Susanne Wienand
Let S(N,n,k) = C(n,k)^(N+1)*Sum_{j=0..N} Sum_{i=0..N} (-1)^(N-j+i)*C(N-i,j)*((n+1)/(k+1))^j. Then S(0,n,k) = A007318(n,k), S(1,n,k) = A103371(n,k), S(2,n,k) = T(n,k), S(3,n,k) = A197653(n,k), S(4,n,k) = A197654(n,k), S(5,n,k) = A197655(n,k). - Peter Luschny, Oct 21 2011
The number triangle can be calculated recursively by the number triangles A103371 and A007318. The first column of the triangle contains the central polygonal numbers A002061. The diagonal right hand is A000012. The diagonal with k = n-1 seems to be A027444. Row sums are in A197657. - Susanne Wienand, Nov 24 2011
The conjectured formulas are confirmed by dynamic programming for 0 <= n <= 62. - Susanne Wienand, Jun 24 2015

Examples

			For n = 4 and k = 2, T(3,4,2) = 456.
Recursive example:
T(1,4,0) = 1
T(1,4,1) = 4
T(1,4,2) = 6
T(1,4,3) = 4
T(1,4,4) = 1
T(2,4,0) = 5
T(2,4,1) = 40
T(2,4,2) = 60
T(2,4,3) = 20
T(2,4,4) = 1
T(3,4,0) = T(1,4,0)^3 + T(1,4,0)*T(2,4,4-1-0) = 1^3 + 1*20 = 21
T(3,4,1) = T(1,4,1)^3 + T(1,4,1)*T(2,4,4-1-1) = 4^3 + 4*60 = 304
T(3,4,2) = T(1,4,2)^3 + T(1,4,2)*T(2,4,4-1-2) = 6^3 + 6*40 = 456
T(3,4,3) = T(1,4,3)^3 + T(1,4,3)*T(2,4,4-1-3) = 4^3 + 4*5  = 84
T(3,4,4) = 1.
Example for closed formula:
T(4,2) = (C(4,2))^3 + C(4,2) * C(4,3) * C(5,3) = 6^3 + 6 * 4 * 10 = 456.
Some examples of list S and allocated values of dir if n = 4 and k = 2:
Length(S) = (4+1)*3 = 15 and S contains (2+1)*3 = 9 L's.
  S: L,L,L,L,L,L,L,L,L,R,R,R,R,R,R
dir: 1,2,0,1,2,0,1,2,0,0,2,1,0,2,1
  S: L,L,R,L,L,L,L,R,R,L,R,R,L,R,L
dir: 1,2,2,2,0,1,2,2,1,1,1,0,0,0,0
  S: L,R,R,R,L,L,L,L,R,R,L,L,L,R,L
dir: 1,1,0,2,2,0,1,2,2,1,1,2,0,0,0
Each value of dir occurs 15/3 = 5 times.
		

Crossrefs

Programs

  • Maple
    A194595 := (n,k)->binomial(n,k)^3*(k^2+k+1+n^2+n-k*n)/((k+1)^2);
    seq(print(seq(A194595(n,k),k=0..n)),n=0..7); # Peter Luschny, Oct 14 2011
  • Mathematica
    T[n_, k_] := Binomial[n, k]^3*(k^2 + k + 1 + n^2 + n - k*n)/((k + 1)^2);
    Table[T[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 30 2018, after Peter Luschny *)
  • PARI
    A194595(n,k) = {if(n == 1+2*k,3,(1+k)*(1-((n-k)/(1+k))^3)/(1+2*k-n))*binomial(n,k)^3} \\ Peter Luschny, Nov 24 2011

Formula

Recursive formula (conjectured):
T(n,k) = T(3,n,k) = T(1,n,k)^3 + T(1,n,k)*T(2,n,n-1-k), 0 <= k < n
T(3,n,n) = 1, k = n
T(2,n,k) = T(1,n,k)^2 + T(1,n,k) * T(1,n,n-1-k), 0 <= k < n
T(2,n,n) = 1, k = n
T(2,n,k) = A103371,
T(1,n,k) = A007318 (Pascal's Triangle).
Closed formula (conjectured): T(n,k) = (C(n,k))^3 + C(n,k) * C(n,k+1) * C(n+1,k+1). - Susanne Wienand
Let S(n,k) = binomial(2*n,n)^(k+1)*((n+1)^(k+1)-n^(k+1))/(n+1)^k. Then T(2*n,n) = S(n,2). - Peter Luschny, Oct 20 2011
T(n,k) = A073254(n+1,k+1)C(n,k)^3/(k+1)^2. - Peter Luschny, Oct 29 2011
T(n,k) = h(n,k)*binomial(n,k)^3, where h(n,k) = (1+k)*(1-((n-k)/(1+k))^3)/(1+2*k-n) if 1+2*k-n <> 0 else h(n,k) = 3. - Peter Luschny, Nov 24 2011

A198064 Triangle read by rows (n >= 0, 0 <= k <= n, m = 4); T(n,k) = Sum{j=0..m} Sum{i=0..m} (-1)^(j+i)*C(i,j)*n^j*k^(m-j).

Original entry on oeis.org

0, 1, 1, 16, 5, 16, 81, 31, 31, 81, 256, 121, 80, 121, 256, 625, 341, 211, 211, 341, 625, 1296, 781, 496, 405, 496, 781, 1296, 2401, 1555, 1031, 781, 781, 1031, 1555, 2401, 4096, 2801, 1936, 1441, 1280, 1441, 1936, 2801, 4096, 6561, 4681, 3355, 2511, 2101
Offset: 0

Views

Author

Peter Luschny, Oct 26 2011

Keywords

Examples

			[0]                      0
[1]                     1, 1
[2]                  16, 5, 16
[3]                81, 31, 31, 81
[4]            256, 121, 80, 121, 256
[5]         625, 341, 211, 211, 341, 625
[6]     1296, 781, 496, 405, 496, 781, 1296
[7] 2401, 1555, 1031, 781, 781, 1031, 1555, 2401
		

Crossrefs

Programs

  • Maple
    A198064 := (n,k) -> k^4-2*k^3*n+4*k^2*n^2-3*k*n^3+n^4:

Formula

T(n,k) = k^4-2*k^3*n+4*k^2*n^2-3*k*n^3+n^4.
T(n,0) = T(n,n) = n^m = n^4 = A000583(n).
T(2n,n) = (m+1)n^m = 5n^4.
T(2n+1,n+1) = (n+1)^(m+1)-n^(m+1) = (n+1)^5-n^5 = A022521(n).
Sum{k=0..n} T(n,k) = (16n^5+30n^4+15n^3-n)/30.
T(n+1,k+1)C(n,k)^5/(k+1)^4 = A197654(n,k).

A198065 Triangle read by rows (n >= 0, 0 <= k <= n, m = 5); T(n,k) = Sum{j=0..m} Sum{i=0..m} (-1)^(j+i)*C(i,j)*n^j*k^(m-j).

Original entry on oeis.org

0, 1, 1, 32, 6, 32, 243, 63, 63, 243, 1024, 364, 192, 364, 1024, 3125, 1365, 665, 665, 1365, 3125, 7776, 3906, 2016, 1458, 2016, 3906, 7776, 16807, 9331, 5187, 3367, 3367, 5187, 9331, 16807, 32768, 19608, 11648, 7448, 6144, 7448, 11648, 19608, 32768, 59049
Offset: 0

Views

Author

Peter Luschny, Oct 26 2011

Keywords

Examples

			[0]                        0
[1]                       1, 1
[2]                    32, 6, 32
[3]                 243, 63, 63, 243
[4]            1024, 364, 192, 364, 1024
[5]         3125, 1365, 665, 665, 1365, 3125
[6]     7776, 3906, 2016, 1458, 2016, 3906, 7776
[7] 16807, 9331, 5187, 3367, 3367, 5187, 9331, 16807
		

Crossrefs

Programs

  • Magma
    &cat[[n*(k^2-k*n+n^2)*(3*k^2-3*k*n+n^2): k in [0..n]]: n in [0..9]];  // Bruno Berselli, Nov 02 2011
  • Maple
    A198065 := (n,k) -> 3*n*k^4-6*k^3*n^2+7*k^2*n^3-4*k*n^4+n^5:

Formula

T(n,k) = 3*n*k^4-6*k^3*n^2+7*k^2*n^3-4*k*n^4+n^5.
T(n,0) = T(n,n) = n^m = n^5 = A000584(n).
T(2n,n) = (m+1)n^m = 6n^5.
T(2n+1,n+1) = (n+1)^(m+1)-n^(m+1) = (n+1)^6-n^6 = A022522(n).
Sum{k=0..n} T(n,k) = (13n^6+30n^5+20n^4-3n^2)/30.
T(n+1,k+1)C(n,k)^6/(k+1)^5 = A197655(n,k).

A117066 Partial sums of cupolar numbers (1/3)*(n+1)*(5*n^2+7*n+3) (A096000).

Original entry on oeis.org

1, 11, 48, 140, 325, 651, 1176, 1968, 3105, 4675, 6776, 9516, 13013, 17395, 22800, 29376, 37281, 46683, 57760, 70700, 85701, 102971, 122728, 145200, 170625, 199251, 231336, 267148, 306965, 351075, 399776, 453376, 512193, 576555, 646800, 723276, 806341
Offset: 1

Views

Author

Jonathan Vos Post, Apr 17 2006

Keywords

Comments

Consider the partitions of 2n into two parts (p,q) where p <= q. Then a(n) is the total volume of the family of rectangular prisms with dimensions p, p and q. - Wesley Ivan Hurt, Apr 15 2018

Examples

			For n=6, 9*a(6) = 6^3 + 7^3 + 8^3 + 9^3 + 10^3 + 11^3 +12^3 = 9*651. - _Bruno Berselli_, Apr 01 2014
		

Crossrefs

Programs

  • GAP
    List([1..40], n-> n^2*(n+1)*(5*n+1)/12); # G. C. Greubel, Jul 05 2019
  • Magma
    [n^2*(n+1)*(5*n+1)/12: n in [1..40]]; // Vincenzo Librandi, Apr 16 2018
    
  • Maple
    a:=n->sum ((n+j)^3, j=0..n): seq(a(n)/9, n=1..40);# Zerinvary Lajos, Dec 17 2008
  • Mathematica
    Table[Sum[n i (n + i), {i, 0, n}]/2, {n, 40}] (* Vladimir Joseph Stephan Orlovsky, Jun 03 2011 *)
    Accumulate[Table[((n+1)(5n^2+7n+3))/3,{n,0,50}]] (* or *) LinearRecurrence[{5,-10,10,-5,1},{1,11,48,140,325},50] (* Harvey P. Dale, Jan 03 2024 *)
  • PARI
    my(x='x+O('x^40)); Vec(x*(3*x^2+6*x+1)/(1-x)^5) \\ G. C. Greubel, Jul 19 2017
    
  • PARI
    a(n) = n^2*(n+1)*(5*n+1)/12; \\ Altug Alkan, Apr 16 2018
    
  • Sage
    [n^2*(n+1)*(5*n+1)/12 for n in (1..40)] # G. C. Greubel, Jul 05 2019
    

Formula

a(n) = Sum_{i=1..n} A096000(i).
a(n) = Sum_{i=1..n} (1/3)*(i+1)*(5*i^2+7*i+3).
a(n) = Sum_{i=1..n} (1/2)*(Q(i) + 3*i^2 + 3*i + 1), where Q(i) are the cuboctahedral numbers (A005902).
a(n) = Sum_{i=0..n} A073254(n,i)*i. - Peter Luschny, Oct 29 2011
G.f.: x*(1+6*x+3*x^2) / (1-x)^5. - Colin Barker, May 08 2013
9*a(n) = Sum_{i=0..n} (n+i)^3, see Maple code by Zerinvary Lajos. - Bruno Berselli, Apr 01 2014
a(n) = n^2*(n+1)*(5*n+1)/12. - Vaclav Kotesovec, Jan 03 2017
E.g.f.: (x/12)*(12 + 54*x + 36*x^2 + 5*x^3)*exp(x). - G. C. Greubel, Jul 19 2017
Another identity: ..., a(4) = (1/2)*(7*(2+4+6+8)+5*(4+6+8)+3*(6+8)+1*(8)) = 140, a(5) = (1/2)*(9*(2+4+6+8+10)+7*(4+6+8+10)+5*(6+8+10)+3*(8+10)+1*(10)) = 325, ... - J. M. Bergot, Aug 25 2022

Extensions

Terms corrected by Colin Barker, May 08 2013

A198062 Array read by antidiagonals, m>=0, n>=0, k>=0, A(m, n, k) = sum{j=0..m} sum{i=0..m} (-1)^(j+i)*C(i,j)*n^j*k^(m-j).

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 4, 2, 1, 0, 1, 1, 8, 3, 2, 1, 0, 1, 1, 16, 4, 4, 3, 1, 0, 1, 1, 32, 5, 8, 9, 3, 1, 0, 1, 1, 64, 6, 16, 27, 7, 3, 1, 0, 1, 1, 128, 7, 32, 81, 15, 7, 3, 1, 0, 1, 1, 256, 8, 64, 243, 31, 15, 9, 4, 1, 0, 1, 1, 512, 9
Offset: 0

Views

Author

Peter Luschny, Nov 02 2011

Keywords

Examples

			   [0] [1] [2]  [3] [4]  [5]  [6]  [7]  [8]  [9]
-------------------------------------------------
[0]  1   1   1    1   1    1    1    1    1    1    A000012
[1]  0   1   1    2   2    2    3    3    3    3    A003056
[2]  0   1   1    4   3    4    9    7    7    9    A073254
[3]  0   1   1    8   4    8   27   15   15   27    A198063
[4]  0   1   1   16   5   16   81   31   31   81    A198064
[5]  0   1   1   32   6   32  243   63   63  243    A198065
		

Crossrefs

Programs

  • Maple
    A198062_RowAsTriangle := proc(m) local pow; pow :=(a,b)->`if`(a=0 and b=0,1,a^b): proc(n, k) local i, j; add(add((-1)^(j + i)*binomial(i, j)*pow(n, j)* pow(k, m-j), i=0..m),j=0..m) end: end:
    for m from 0 to 2 do seq(print(seq(A198062_RowAsTriangle(m)(n,k),k=0..n)),n=0..5) od;
  • Mathematica
    max = 9; RowAsTriangle[m_][n_, k_] := Module[{pow}, pow[a_, b_] := If[a == 0 && b == 0, 1, a^b]; Module[{i, j}, Sum[Sum[(-1)^(j+i)*Binomial[i, j]*pow[n, j]*pow[k, m-j], {i, 0, m}], {j, 0, m}]]]; t = Flatten /@ Table[RowAsTriangle[m][n, k], {m, 0, max}, {n, 0, max}, {k, 0, n}]; Table[t[[n-k+1, k+1]], {n, 0, max}, {k, 0, n }] // Flatten (* Jean-François Alcover, Feb 25 2014, after Maple *)

Formula

A007318(n,k) = A(0,n+1,k+1)*C(n,k)^1/(k+1)^0,
A103371(n,k) = A(1,n+1,k+1)*C(n,k)^2/(k+1)^1,
A194595(n,k) = A(2,n+1,k+1)*C(n,k)^3/(k+1)^2,
A197653(n,k) = A(3,n+1,k+1)*C(n,k)^4/(k+1)^3,
A197654(n,k) = A(4,n+1,k+1)*C(n,k)^5/(k+1)^4,
A197655(n,k) = A(5,n+1,k+1)*C(n,k)^6/(k+1)^5.

A349039 Square array T(n, k) read by antidiagonals, n, k >= 0; T(n, k) = n^2 - n*k + k^2.

Original entry on oeis.org

0, 1, 1, 4, 1, 4, 9, 3, 3, 9, 16, 7, 4, 7, 16, 25, 13, 7, 7, 13, 25, 36, 21, 12, 9, 12, 21, 36, 49, 31, 19, 13, 13, 19, 31, 49, 64, 43, 28, 19, 16, 19, 28, 43, 64, 81, 57, 39, 27, 21, 21, 27, 39, 57, 81, 100, 73, 52, 37, 28, 25, 28, 37, 52, 73, 100, 121, 91, 67, 49, 37, 31, 31, 37, 49, 67, 91, 121
Offset: 0

Views

Author

Rémy Sigrist, Nov 06 2021

Keywords

Comments

T(n, k) is the norm of the Eisenstein integer n + k*w (where w = -1/2 + sqrt(-3)/2 is a primitive cube root of unity).
All terms belong to A003136.

Examples

			Array T(n, k) begins:
  n\k|    0   1   2   3   4   5   6   7   8   9   10
  ---+----------------------------------------------
    0|    0   1   4   9  16  25  36  49  64  81  100
    1|    1   1   3   7  13  21  31  43  57  73   91
    2|    4   3   4   7  12  19  28  39  52  67   84
    3|    9   7   7   9  13  19  27  37  49  63   79
    4|   16  13  12  13  16  21  28  37  48  61   76
    5|   25  21  19  19  21  25  31  39  49  61   75
    6|   36  31  28  27  28  31  36  43  52  63   76
    7|   49  43  39  37  37  39  43  49  57  67   79
    8|   64  57  52  49  48  49  52  57  64  73   84
    9|   81  73  67  63  61  61  63  67  73  81   91
   10|  100  91  84  79  76  75  76  79  84  91  100
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := n^2 - n*k + k^2; Table[T[k, n - k], {n, 0, 11}, {k, 0, n}] // Flatten (* Amiram Eldar, Nov 08 2021 *)
  • PARI
    T(n,k) = n^2 - n*k + k^2

Formula

T(n, k) = T(k, n).
T(n, 0) = T(n, n) = n^2.
T(n, k) = A048147(n, k) - A004247(n, k).
G.f.: (x - 5*x*y + y*(1 + y) + x^2*(1 + y^2))/((1 - x)^3*(1 - y)^3). - Stefano Spezia, Nov 08 2021
Showing 1-8 of 8 results.