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.

A003983 Array read by antidiagonals with T(n,k) = min(n,k).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 3, 2, 1, 1, 2, 3, 4, 3, 2, 1, 1, 2, 3, 4, 4, 3, 2, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1
Offset: 1

Views

Author

Keywords

Comments

Also, "correlation triangle" for the constant sequence 1. - Paul Barry, Jan 16 2006
Antidiagonal sums are in A002620.
As a triangle, row sums are A002620. T(2n,n)=n+1. Diagonal sums are A001399. Construction: Take antidiagonal triangle of MM^T where M is the sequence array for the constant sequence 1 (lower triangular matrix with all 1's). - Paul Barry, Jan 16 2006
From Franklin T. Adams-Watters, Sep 25 2011: (Start)
As a triangle, count up to ceiling(n/2) and back down again (repeating the central term when n is even).
When the first two instances of each number are removed from the sequence, the original sequence is recovered.
(End)

Examples

			Triangle version begins
  1;
  1, 1;
  1, 2, 1;
  1, 2, 2, 1;
  1, 2, 3, 2, 1;
  1, 2, 3, 3, 2, 1;
  1, 2, 3, 4, 3, 2, 1;
  1, 2, 3, 4, 4, 3, 2, 1;
  1, 2, 3, 4, 5, 4, 3, 2, 1;
  ...
		

Crossrefs

Programs

  • Haskell
    a003983 n k = a003983_tabl !! (n-1) !! (k-1)
    a003983_tabl = map a003983_row [1..]
    a003983_row n = hs ++ drop m (reverse hs)
       where hs = [1..n' + m]
             (n',m) = divMod n 2
    -- Reinhard Zumkeller, Aug 14 2011
    
  • Maple
    a(n) = min(floor(1/2 + sqrt(2*n)) - (2*n + round(sqrt(2*n)) - round(sqrt(2*n))^2)/2+1, (2*n + round(sqrt(2*n)) - round(sqrt(2*n))^2)/2) # Leonid Bedratyuk, Dec 13 2009
  • Mathematica
    Flatten[Table[Min[n-k+1, k], {n, 1, 14}, {k, 1, n}]] (* Jean-François Alcover, Feb 23 2012 *)
  • PARI
    T(n,k) = min(n,k) \\ Charles R Greathouse IV, Feb 06 2017
    
  • Python
    from math import isqrt
    def A003983(n):
        a = (m:=isqrt(k:=n<<1))+(k>m*(m+1))
        x = n-(a*(a-1)>>1)
        return min(x,a-x+1) # Chai Wah Wu, Jun 14 2025

Formula

Number triangle T(n, k) = Sum_{j=0..n} [j<=k][j<=n-k]. - Paul Barry, Jan 16 2006
G.f.: 1/((1-x)*(1-x*y)*(1-x^2*y)). - Christian G. Bower, Jan 17 2006
a(n) = min(floor( 1/2 + sqrt(2*n)) - (2*n + round(sqrt(2*n)) - round(sqrt(2*n))^2)/2+1, (2*n + round(sqrt(2*n)) - round(sqrt(2*n))^2)/2). - Leonid Bedratyuk, Dec 13 2009

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 08 2000
Entry revised by N. J. A. Sloane, Dec 05 2006

A133823 Triangle whose rows are sequences of increasing and decreasing cubes:1; 1,8,1; 1,8,27,8,1; ... .

Original entry on oeis.org

1, 1, 8, 1, 1, 8, 27, 8, 1, 1, 8, 27, 64, 27, 8, 1, 1, 8, 27, 64, 125, 64, 27, 8, 1, 1, 8, 27, 64, 125, 216, 125, 64, 27, 8, 1, 1, 8, 27, 64, 125, 216, 343, 216, 125, 64, 27, 8, 1, 1, 8, 27, 64, 125, 216, 343, 512, 343, 216, 125, 64, 27, 8, 1, 1, 8, 27, 64, 125, 216, 343, 512, 729
Offset: 0

Views

Author

Peter Bala, Sep 25 2007

Keywords

Comments

Reading the triangle by rows produces the sequence 1,1,8,1,1,8,27,8,1,..., analogous to A004737.
T(n,k) = min(n,k)^3. The order of the list T(n,k) is by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - Boris Putievskiy, Jan 13 2013

Examples

			Triangle starts
  1;
  1, 8, 1;
  1, 8, 27, 8, 1;
  1, 8, 27, 64, 27, 8, 1;
From _Boris Putievskiy_, Jan 13 2013: (Start)
The start of the sequence as table:
  1...1...1...1...1...1...
  1...8...8...8...8...8...
  1...8..27..27..27..27...
  1...8..27..64..64..64...
  1...8..27..64.125.125...
  1...8..27..64.125.216...
  . . .
The start of the sequence as triangle array read by rows:
  1;
  1,8,1;
  1,8,27,8,1;
  1,8,27,64,27,8,1;
  1,8,27,64,125,64,27,8,1;
  1,8,27,64,125,216,125,64,27,8,1;
  . . .
Row number k contains 2*k-1 numbers 1,8,...,(k-1)^3,k^3,(k-1)^3,...,8,1. (End)
		

Crossrefs

Programs

  • Mathematica
    Table[Join[Range[n]^3,Range[n-1,1,-1]^3],{n,10}]//Flatten (* Harvey P. Dale, May 29 2019 *)

Formula

O.g.f.: (1+qx)(1+4qx+q^2x^2)/((1-x)(1-qx)^3(1-q^2x)) = 1 + x(1 + 8q + q^2) + x^2(1 + 8q + 27q^2 + 8q^3 + q^4) + ... .
From Boris Putievskiy, Jan 13 2013: (Start)
a(n) = (A004737(n))^3.
a(n) = (floor(sqrt(n-1)) - |n- floor(sqrt(n-1))^2- floor(sqrt(n-1))-1| +1)^3. (End)

A133824 Triangle whose rows are sequences of increasing and decreasing fourth powers: 1; 1,16,1; 1,16,81,16,1; ... .

Original entry on oeis.org

1, 1, 16, 1, 1, 16, 81, 16, 1, 1, 16, 81, 256, 81, 16, 1, 1, 16, 81, 256, 625, 256, 81, 16, 1, 1, 16, 81, 256, 625, 1296, 625, 256, 81, 16, 1, 1, 16, 81, 256, 625, 1296, 2401, 1296, 625, 256, 81, 16, 1, 1, 16, 81, 256, 625, 1296, 2401, 4096, 2401, 1296, 625, 256, 81, 16
Offset: 0

Views

Author

Peter Bala, Sep 25 2007

Keywords

Comments

Reading the triangle by rows produces the sequence 1,1,16,1,1,16,81,16,1,..., analogous to A004737.
From - Boris Putievskiy, Jan 13 2013: (Start)
The order of the list T(n,k) is by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1).
Row number k contains 2*k-1 numbers 1,16,...,(k-1)^4,k^4,(k-1)^4,...,16,1. (End)

Examples

			Triangle starts:
  1;
  1, 16, 1;
  1, 16, 81, 16, 1;
  1, 16, 81, 256, 81, 16, 1;
  ...
From _Boris Putievskiy_, Jan 13 2013: (Start)
The start of the sequence as table:
  1...1...1...1...1.. .1...
  1..16..16..16..16...16...
  1..16..81..81..81...81...
  1..16..81.256.256..256...
  1..16..81.256.625..625...
  1..16..81.256.625.1296...
  ...
(End)
		

Crossrefs

Programs

  • Mathematica
    p4[n_]:=Module[{c=Range[n]^4},Join[c,Rest[Reverse[c]]]]; Flatten[p4/@ Range[10]] (* Harvey P. Dale, Dec 08 2014 *)

Formula

O.g.f.: (1+qx)(1+11qx+11q^2x^2+q^3x^3)/((1-x)(1-qx)^4(1-q^2x)) = 1 + x(1 + 16q + q^2) + x^2(1 + 16q + 81q^2 + 16q^3 + q^4) + ... . Cf. 4th row of A008292.
From Boris Putievskiy, Jan 13 2013: (Start)
T(n,k) = min(n,k)^4.
a(n) = (A004737(n))^4.
a(n) = (A124258(n))^2.
a(n) = (floor(sqrt(n-1)) - |n- floor(sqrt(n-1))^2- floor(sqrt(n-1))-1| +1)^4. (End)

A133825 Triangle whose rows are sequences of increasing and decreasing triangular numbers: 1; 1,3,1; 1,3,6,3,1; ... .

Original entry on oeis.org

1, 1, 3, 1, 1, 3, 6, 3, 1, 1, 3, 6, 10, 6, 3, 1, 1, 3, 6, 10, 15, 10, 6, 3, 1, 1, 3, 6, 10, 15, 21, 15, 10, 6, 3, 1, 1, 3, 6, 10, 15, 21, 28, 21, 15, 10, 6, 3, 1, 1, 3, 6, 10, 15, 21, 28, 36, 28, 21, 15, 10, 6, 3, 1, 1, 3, 6, 10, 15, 21, 28, 36, 45, 36, 28, 21, 15, 10, 6, 3, 1, 1, 3, 6, 10
Offset: 0

Views

Author

Peter Bala, Sep 25 2007

Keywords

Comments

Reading the triangle by rows produces the sequence 1,1,3,1,1,3,6,3,1,..., analogous to A004737.
T(n,k) = min(n*(n+1)/2,k*(k+1)/2), n, k >0. The order of the list T(n,k) is by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - Boris Putievskiy, Jan 13 2013

Examples

			Triangle starts
  1;
  1, 3, 1;
  1, 3, 6, 3, 1;
  1, 3, 6, 10, 6, 3, 1;
From _Boris Putievskiy_, Jan 13 2013: (Start)
The start of the sequence as table:
  1...1...1...1...1...1...
  1...3...3...3...3...3...
  1...3...6...6...6...6...
  1...3...6..10..10..10...
  1...3...6..10..15..15...
  1...3...6..10..15..21...
  1...3...6..10..15..21...
  . . .
The start of the sequence as triangle array read by rows:
  1,
  1, 3, 1,
  1, 3, 6, 3, 1,
  1, 3, 6, 10, 6, 3, 1,
  1, 3, 6, 10, 15, 10, 6, 3, 1,
  1, 3, 6, 10, 15, 21, 15, 10, 6, 3, 1,
  1, 3, 6, 10, 15, 21, 28, 21, 15, 10, 6, 3, 1,
  . . .
Row number k contains 2*k-1 numbers 1,3,...,k*(k-1)/2,k*(k+1)/2,k*(k-1)/2,...,3,1. (End)
		

Crossrefs

Cf. A000330 (row sums), A004737, A124258, A133826, A106255.

Programs

  • Mathematica
    Module[{nn=10,ac},ac=Accumulate[Range[nn]];Table[Join[Take[ ac,n],Reverse[ Take[ac,n-1]]],{n,nn}]]//Flatten (* Harvey P. Dale, Apr 18 2019 *)

Formula

O.g.f.: (1+qx)/((1-x)(1-qx)^2(1-q^2x)) = 1 + x(1 + 3q + q^2) + x^2(1 + 3q + 6q^2 + 3q^3 + q^4) + ... .
From Boris Putievskiy, Jan 13 2013: (Start)
a(n) = A004737(n)*(A004737(n)+1)/2.
a(n) = z*(z+1)/2, where z = floor(sqrt(n-1)) - |n- floor(sqrt(n-1))^2- floor(sqrt(n-1))-1| +1. (End)

A133826 Triangle whose rows are sequences of increasing and decreasing tetrahedral numbers: 1; 1,4,1; 1,4,10,4,1; ... .

Original entry on oeis.org

1, 1, 4, 1, 1, 4, 10, 4, 1, 1, 4, 10, 20, 10, 4, 1, 1, 4, 10, 20, 35, 20, 10, 4, 1, 1, 4, 10, 20, 35, 56, 35, 20, 10, 4, 1, 1, 4, 10, 20, 35, 56, 84, 56, 35, 20, 10, 4, 1, 1, 4, 10, 20, 35, 56, 84, 120, 84, 56, 35, 20, 10, 4, 1, 1, 4, 10, 20, 35, 56, 84, 120, 165, 120, 84, 56, 35, 20, 10, 4, 1
Offset: 0

Views

Author

Peter Bala, Sep 25 2007

Keywords

Comments

Reading the triangle by rows produces the sequence 1,1,4,1,1,4,10,4,1,..., analogous to A004737.
T(n,k) = min(n*(n+1)*(n+2)/6, k*(k+1)*(k+2)/6) n, k > 0. The order of the list T(n,k) is by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - Boris Putievskiy, Jan 13 2013

Examples

			Triangle T(n,k) starts:
  1;
  1,  4,  1;
  1,  4, 10,  4,  1;
  1,  4, 10, 20, 10,  4,  1;
  1,  4, 10, 20, 35, 20, 10,  4,  1;
  1,  4, 10, 20, 35, 56, 35, 20, 10,  4,  1;
  1,  4, 10, 20, 35, 56, 84, 56, 35, 20, 10,  4,  1;
  ...
		

Crossrefs

Cf. A000292, A002415 (row sums), A004737, A124258, A133825.

Programs

  • Maple
    T:= n-> (f-> (f(i)$i=1..n, f(n-i)$i=1..n-1))(t-> t*(t+1)*(t+2)/6):
    seq(T(n), n=1..10);  # Alois P. Heinz, Feb 17 2022
  • Mathematica
    Module[{nn=10,tet},tet=Table[(n(n+1)(n+2))/6,{n,nn}];Table[Join[Take[ tet,k], Reverse[ Take[tet,k-1]]],{k,nn}]]//Flatten (* Harvey P. Dale, Oct 22 2017 *)
    Table[Series[(1-h^(2*N+4))^2/(1-h^2)^4-((2+N)^2 *h^(2N+2))/(1-h^2)^2, {h, 0, 4*N}], {N,0,5}] // Normal (* Sergii Voloshyn, Sep 09 2022 *)

Formula

O.g.f.: (1+q*x)/((1-x)*(1-q*x)^3*(1-q^2x)) = 1 + x*(1 + 4*q + q^2) + x^2*(1 + 4*q + 10*q^2 + 4*q^3 + q^4) + ... .
From Boris Putievskiy, Jan 13 2013: (Start)
a(n) = A004737(n)*(A004737(n)+1)*(A004737(n)+2)/2.
a(n) = z*(z+1)*(z+2)/6, where z = floor(sqrt(n-1)) - |n - floor(sqrt(n-1))^2 - floor(sqrt(n-1)) - 1| + 1. (End)
Showing 1-5 of 5 results.