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-5 of 5 results.

A073254 Array read by antidiagonals, A(n,k) = n^2 + n*k + k^2.

Original entry on oeis.org

0, 1, 1, 4, 3, 4, 9, 7, 7, 9, 16, 13, 12, 13, 16, 25, 21, 19, 19, 21, 25, 36, 31, 28, 27, 28, 31, 36, 49, 43, 39, 37, 37, 39, 43, 49, 64, 57, 52, 49, 48, 49, 52, 57, 64, 81, 73, 67, 63, 61, 61, 63, 67, 73, 81, 100, 91, 84, 79, 76, 75, 76, 79, 84, 91, 100, 121, 111, 103, 97
Offset: 0

Views

Author

Michael Somos, Jul 23 2002

Keywords

Comments

Norm of elements in planar hexagonal lattice A_2.
Only numbers which appear in A003136 (Loeschian numbers) can appear in this array. - Peter Luschny, Nov 10 2021

Examples

			Triangle T(n, k) starts:
[0]               0
[1]              1, 1
[2]            4, 3, 4
[3]           9, 7, 7, 9
[4]       16, 13, 12, 13, 16
[5]     25, 21, 19, 19, 21, 25
[6]   36, 31, 28, 27, 28, 31, 36
[7] 49, 43, 39, 37, 37, 39, 43, 49
		

Crossrefs

A033994 gives antidiagonal sums.
Cf. A198063 (m=3), A198064 (m=4), A198065 (m=5).

Programs

  • Maple
    # Using the triangle formula:
    A073254 := (n,k) -> k^2 - k*n + n^2: # Peter Luschny, Oct 26 2011
  • Mathematica
    (* Using the array formula: *)
    A[n_, k_] := n^2 + n k + k^2;
    Table[A[n - k, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 22 2018 *)
  • PARI
    {A(n, k) = n^2 + n*k + k^2}

Formula

From Peter Luschny, Oct 26 2011: (Start)
Let m = 2, for the cases m = 3, 4, and 5 see the cross-references.
T(n,k) = k^2 - k*n + n^2 = A(n-k,k).
T(n,k) = Sum_{j=0..m} Sum_{i=0..m} (-1)^(j+i)*C(i,j)*n^j*k^(m-j) for m = 2.
T(n,0) = T(n,n) = n^m = n^2 = A000290(n).
T(2n,n) = (m+1)*n^m = 3*n^2 = A033428(n).
T(2n+1,n+1) = (n+1)^(m+1) - n^(m+1) = (n+1)^3 - n^3 = A003215(n).
Sum_{k=0..n} T(n,k) = (5*n^3 + 6*n^2 + n)/6 = A033994(n).
T(n+1, k+1)*binomial(n, k)^3/(k+1)^2 = A194595(n,k). (End)

Extensions

Edited by Peter Luschny, Nov 10 2021

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).

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

Original entry on oeis.org

1, 5, 1, 31, 62, 1, 121, 1215, 363, 1, 341, 13504, 20256, 1364, 1, 781, 96875, 500000, 193750, 3905, 1, 1555, 501066, 7321875, 9762500, 1252665, 9330, 1, 2801, 2033647, 72656661, 262609375, 121094435, 6100941, 19607, 1
Offset: 0

Views

Author

Susanne Wienand, Oct 19 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.
Then C is a meander if each value of dir occurs length(S)/m times.
Let T(m,n,k) = number of meanders (m, S, dir) in which S contains m(k+1) L's and m(n-k) R's, so that length(S) = m(n+1).
For this sequence, m = 5, T(n,k) = T(5,n,k).
The values in the triangle were proved by brute force for 0 <= n <= 6. The formulas have not yet been proved in general.
The number triangle can be calculated recursively by the number triangles and A007318, A103371, A194595 and A197653. The first column seems to be A053699. The diagonal right hand is A000012. The diagonal with k = n-1 seems to be A152031 and to start with the second number of A152031. Row sums are in A198257.
The conjectured formulas are confirmed by dynamic programming for 0 <= n <= 29. - Susanne Wienand, Jul 01 2015

Examples

			For n = 5 and k = 2, T(n,k) = 500000
Example for recursive formula:
T(1,5,2) = 10
T(4,5,5-1-2) = T(4,5,2) = 40000
T(5,5,2) = 10^5 + 10*40000 = 500000
Example for closed formula:
T(5,2) = A + B + C + D + E
A = 10^5
B = 10^4 * 10
C = 10^3 * 10^2
D = 10^2 * 10^3
E = 10   * 10^4
T(5,2) = 5 * 10^5 = 500000
Some examples of list S and allocated values of dir if n = 5 and k = 2:
Length(S) = (5+1)*5 = 30 and S contains (2+1)*5 = 15 Ls.
  S: L,L,L,L,L,L,L,L,L,L,L,L,L,L,L,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R
dir: 1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,0,4,3,2,1,0,4,3,2,1,0,4,3,2,1
  S: L,L,L,L,L,L,L,R,R,L,L,R,R,R,L,R,R,R,L,R,L,L,L,R,R,L,R,R,R,R
dir: 1,2,3,4,0,1,2,2,1,1,2,2,1,0,0,0,4,3,3,3,3,4,0,0,4,4,4,3,2,1
  S: L,L,L,L,L,R,L,L,L,L,L,R,L,R,R,R,R,R,R,R,R,R,R,L,L,L,L,R,R,R
dir: 1,2,3,4,0,0,0,1,2,3,4,4,4,4,3,2,1,0,4,3,2,1,0,0,1,2,3,3,2,1
Each value of dir occurs 30/5 = 6 times.
The triangle begins:
1,
5, 1,
31, 62, 1,
121, 1215, 363, 1,
341, 13504, 20256, 1364, 1,
781, 96875, 500000, 193750, 3905, 1,
...
		

Crossrefs

Programs

  • Maple
    A197654 := (n,k)->(k^4+2*k^3*(1-n)+2*k^2*(2+n+2*n^2)+k*(3+n-n^2-3*n^3)+ n^4+n^3+n^2+n+1)*binomial(n,k)^5/(1+k)^4;
    seq(print(seq(A197654(n, k), k=0..n)), n=0..7);  # Peter Luschny, Oct 20 2011
  • Mathematica
    T[n_, k_] := (k^4 + 2*k^3*(1-n) + 2*k^2*(2+n+2*n^2) + k*(3+n-n^2-3*n^3) + n^4+n^3+n^2+n+1)*Binomial[n, k]^5/(1+k)^4; Table[T[n, k], {n, 0, 7}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 20 2017, after Peter Luschny *)
  • PARI
    A197654(n,k) = {if(n ==1+2*k,5,(1+k)*(1-((n-k)/(1+k))^5)/(1+2*k-n))*binomial(n,k)^5} \\ Peter Luschny, Nov 24 2011
  • Sage
    def S(N,n,k) : return binomial(n,k)^(N+1)*sum(sum((-1)^(N-j+i)*binomial(N-i,j)*((n+1)/(k+1))^j for i in (0..N) for j in (0..N)))
    def A197654(n,k) : return S(4,n,k)
    for n in (0..5) : print([A197654(n,k) for k in (0..n)])  # Peter Luschny, Oct 24 2011
    

Formula

Recursive formula (conjectured):
T(n,k) = T(5,n,k) = T(1,n,k)^5 + T(1,n,k)*T(4,n,n-1-k), 0 <= k < n
T(5,n,n) = 1 k = n
T(4,n,k) = T(1,n,k)^4 + T(1,n,k) * T(3,n,n-1-k), 0 <= k < n
T(4,n,n) = 1 k = n
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(4,n,k) = A197653
T(3,n,k) = A194595
T(2,n,k) = A103371
T(1,n,k) = A007318 (Pascal's Triangle)
Closed formula (conjectured): T(n,n) = 1, k = n
T(n,k) = A + B + C + D + E, k < n
A = (C(n,k))^5
B = (C(n,k))^4 * C(n,n-1-k)
C = (C(n,k))^3 *(C(n,n-1-k))^2
D = (C(n,k))^2 *(C(n,n-1-k))^3
E = C(n,k) *(C(n,n-1-k))^4 [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,4). [Peter Luschny, Oct 20 2011]
T(n,k) = A198064(n+1,k+1)C(n,k)^5/(k+1)^4. [Peter Luschny, Oct 29 2011]
T(n,k) = h(n,k)*binomial(n,k)^5, where h(n,k) = (1+k)*(1-((n-k)/(1+k))^5)/(1+2*k-n) if 1+2*k-n <> 0 else h(n,k) = 5. [Peter Luschny, Nov 24 2011]

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).

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.
Showing 1-5 of 5 results.