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.

A347026 Irregular triangle read by rows in which row n lists the first n odd numbers, followed by the first n odd numbers in decreasing order.

Original entry on oeis.org

1, 1, 1, 3, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 7, 7, 5, 3, 1, 1, 3, 5, 7, 9, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 13, 13, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 13, 15, 15, 13, 11, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 17, 15, 13, 11, 9, 7, 5, 3, 1
Offset: 1

Views

Author

Eddie Gutierrez, Aug 11 2021

Keywords

Comments

The terms of this sequence are the numbers in an irregular triangle corresponding to the addition of rows when multiplying two large numbers via a novel method (see Links).
Sums of the rising diagonals yield sequence A007980.
When the 2n terms in row n are used as the coefficients of a (2n-1)st-order polynomial in x, dividing that polynomial by x+1 produces a (2n-2)nd-order polynomial whose coefficients are the n-th row of A004737 (if that sequence is taken as an irregular triangle with 2n-1 terms in its n-th row). E.g., for n=3, (x^5 + 3x^4 + 5x^3 + 5x^2 + 3x + 1)/(x+1) = x^4 + 2x^3 + 3x^2 + 2x + 1.

Examples

			Triangle begins:
  1,  1;
  1,  3,  3,  1;
  1,  3,  5,  5,  3,  1;
  1,  3,  5,  7,  7,  5,  3,  1;
  1,  3,  5,  7,  9,  9,  7,  5,  3,  1;
  1,  3,  5,  7,  9, 11, 11,  9,  7,  5,  3,  1;
  1,  3,  5,  7,  9, 11, 13, 13, 11,  9,  7,  5,  3,  1;
  1,  3,  5,  7,  9, 11, 13, 15, 15, 13, 11,  9,  7,  5,  3,  1;
...
		

Crossrefs

Even-indexed rows of A157454.
Antidiagonal sums give A007980.
Row lengths give nonzero terms of A005843.
Cf. A004737.

Programs

  • C
    #include 
    int main()
    {
       int n, k;
       for (n=1; n<=13; n++)
       {
          for (k=1; k<=n; k++)
          {
             printf("%d ", 2*k - 1);
          }
          for (k=n+1; k<=2*n; k++)
          {
             printf("%d ", 4*n - 2*k + 1);
          }
          printf("\n");
       }
       return 0;
    }
    
  • Mathematica
    Array[Join[#, Reverse[#]] &@Range[1, 2 # - 1, 2] &, 9] // Flatten (* Michael De Vlieger, Aug 18 2021 *)
    Flatten[Table[Join[Range[1,2n+1,2],Range[2n+1,1,-2]],{n,0,10}]] (* Harvey P. Dale, Aug 31 2024 *)
  • PARI
    row(n) = n*=2; vector(n, k, min(2*k-1, 2*(n-k)+1)); \\ Michel Marcus, Aug 17 2021

Formula

T(n,k) = 2k - 1 for 1 <= k <= n,
4n - 2k + 1 for n+1 <= k <= 2n.

Extensions

Better definition from Omar E. Pol, Aug 14 2021