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.

A004247 Multiplication table read by antidiagonals: T(i,j) = i*j (i>=0, j>=0). Alternatively, multiplication triangle read by rows: P(i,j) = j*(i-j) (i>=0, 0<=j<=i).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 4, 3, 0, 0, 4, 6, 6, 4, 0, 0, 5, 8, 9, 8, 5, 0, 0, 6, 10, 12, 12, 10, 6, 0, 0, 7, 12, 15, 16, 15, 12, 7, 0, 0, 8, 14, 18, 20, 20, 18, 14, 8, 0, 0, 9, 16, 21, 24, 25, 24, 21, 16, 9, 0, 0, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 0, 0, 11, 20, 27, 32, 35, 36, 35, 32, 27, 20, 11, 0, 0, 12, 22, 30, 36, 40, 42, 42, 40, 36, 30
Offset: 0

Views

Author

Keywords

Comments

Table of x*y, where (x,y) = (0,0),(0,1),(1,0),(0,2),(1,1),(2,0),...
Or, triangle read by rows, in which row n gives the numbers 0, n*1, (n-1)*2, (n-2)*3, ..., 2*(n-1), 1*n, 0.
Letting T(n,k) be the (k+1)st entry in the (n+1)st row (same numbering used for Pascal's triangle), T(n,k) is the dimension of the space of all k-dimensional subspaces of a (fixed) n-dimensional real vector space. - Paul Boddington, Oct 21 2003
From Dennis P. Walsh, Nov 10 2009: (Start)
Triangle P(n,k), 0<=k<=n, equals n^2 x the variance of a binary data set with k zeros and (n-k) ones. [For the case when n=0, let the variance of the empty set be defined as 0.]
P(n,k) is also the number of ways to form an opposite-sex dance couple from k women and (n-k) men. (End)
P(n,k) is the number of negative products of two numbers from a set of n real numbers, k of which are negative. - Logan Pipes, Jul 08 2021

Examples

			As the triangle P, sequence begins:
  0;
  0,0;
  0,1,0;
  0,2,2,0;
  0,3,4,3,0;
  0,4,6,6,4,0,;
  0,5,8,9,8,5,0;
  ...
From _Dennis P. Walsh_, Nov 10 2009: (Start)
P(5,2)=T(2,3)=6 since the variance of the data set <0,0,1,1,1> equals 6/25.
P(5,2)=6 since, with 2 women, say Alice and Betty, and with 3 men, say Charles, Dennis, and Ed, the dance couple is one of the following: {Alice, Charles}, {Alice, Dennis}, {Alice, Ed}, {Betty, Charles}, {Betty, Dennis} and {Betty, Ed}. (End)
		

Crossrefs

See A003991 for another version with many more comments.
Cf. A002262, A025581, A003056, A004197, A003984, A048720, A325820, A000292 (row sums of triangle), A002620.

Programs

Formula

a(n) = A002262(n) * A025581(n). - Antti Karttunen
From Ridouane Oudra, Dec 14 2019: (Start)
a(n) = A004197(n)*A003984(n).
a(n) = (3/4 + n)*t^2 - (1/4)*t^4 - (1/2)*t - n^2 - n, where t = floor(sqrt(2*n+1)+1/2). (End)
P(n,k) = (P(n-1,k-1) + P(n-1,k) + n) / 2. - Robert FERREOL, Jan 16 2020
P(n,floor(n/2)) = A002620(n). - Logan Pipes, Jul 08 2021
From Stefano Spezia, Aug 19 2024: (Start)
G.f. as array: x*y/((1 - x)^2*(1 - y)^2).
E.g.f. as array: exp(x+y)*x*y. (End)

Extensions

Edited by N. J. A. Sloane, Sep 30 2007

A001859 Triangular numbers plus quarter-squares: n*(n+1)/2 + floor((n+1)^2/4) (i.e., A000217(n) + A002620(n+1)).

Original entry on oeis.org

0, 2, 5, 10, 16, 24, 33, 44, 56, 70, 85, 102, 120, 140, 161, 184, 208, 234, 261, 290, 320, 352, 385, 420, 456, 494, 533, 574, 616, 660, 705, 752, 800, 850, 901, 954, 1008, 1064, 1121, 1180, 1240, 1302, 1365, 1430, 1496, 1564, 1633, 1704, 1776, 1850, 1925
Offset: 0

Views

Author

Keywords

Comments

Number of series-reduced planted trees with n+7 nodes and 3 internal nodes.
The trees enumerated with 3 internal nodes are of two types. Those with all internal nodes at different heights are enumerated by the triangular numbers. Those with two internal nodes at the same height are enumerated by the quarter squares. - Michael Somos, May 19 2000
Number of pairs (x,y) with x in {0,...,n}, y even in {0,...,2n}, and x < y. - Clark Kimberling, Jul 02 2012

Examples

			For n=1 we find 2 planted trees with 8 nodes, 3 of which are internal (i) and 5 are endpoints (e):
.e...e...e...e....e...e....
...i.......i........i...e..
.......i..............i...e
.......e................i..
........................e..
G.f. = 2*x + 5*x^2 + 10*x^3 + 16*x^4 + 24*x^5 + 33*x^6 + 44*x^7 + 56*x^8 + ...
		

References

  • John Riordan, personal communication.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

First differences of A045947.
Antidiagonal sums of array A003984.
Cf. A185212 (odd terms).

Programs

  • Haskell
    a001859 n = a000217 n + a002620 (n + 1)  -- Reinhard Zumkeller, Dec 20 2012
  • Maple
    A001859:=(-1-z^2-2*z^3+z^4)/(z+1)/(z-1)^3; # conjectured by Simon Plouffe in his 1992 dissertation; gives sequence with an additional leading 1
    with (combinat):seq(count(Partition((3*n+2)), size=3), n=0..50); # Zerinvary Lajos, Mar 28 2008
  • Mathematica
    With[{nn=60},Total/@Thread[{Accumulate[Range[0,nn]],Floor[Range[ nn+1]^2/4]}]] (* or *) LinearRecurrence[{2,0,-2,1},{0,2,5,10},60] (* Harvey P. Dale, Apr 01 2012 *)
  • PARI
    {a(n) = n + (3*n^2 + 1) \ 4};
    

Formula

a(n) = A000217(n)+A002620(n+1).
a(n) = n + floor( (3n^2+1)/4 ).
G.f.: (2*x+x^2)/((1-x)^2*(1-x^2)).
a(n) = a(n-1) + a(n-2) - a(n-3) + 3 = A002378(n) - A002620(n) = A006578(n-1) + A004526(n+1) - Henry Bottomley, Mar 08 2000
a(n) = A006578(-1-n) for all n in Z. - Michael Somos, May 10 2006
From Mitch Harris, Aug 22 2006: (Start)
a(n) = (6n^2 + 8n + 1 - (-1)^n)/8;
a(n) = Sum_{k=0..n} max(k, n-k). (End)
Starting (2, 5, 10, 16, 24, ...), = binomial transform of [2, 3, 2, -1, 2, -4, 8, -16, 32, ...]. - Gary W. Adamson, Nov 30 2007
a(0)=0, a(1)=2, a(2)=5, a(3)=10, a(n) = 2*a(n-1) + 0*a(n-2) - 2*a(n-3) + a(n-4). - Harvey P. Dale, Apr 01 2012
a(n) = 3*n*(n+1)/2 - A006578(n). - Clark Kimberling, Jul 02 2012
a(2*n) = A045944(n), a(2*n - 1) = A049450(n) for all n in Z. - Michael Somos, Nov 03 2014
0 = -6 + a(n) - 2*a(n+2) + a(n+4) for all n in Z. - Michael Somos, Nov 03 2014
0 = a(n)*(+a(n+1) - a(n+2)) + a(n+1)*(-3 - a(n+1) + a(n+2)) for all n in Z. - Michael Somos, Nov 03 2014
a(n) = Sum_{k=1..n} floor((n+k+2)/2). - Wesley Ivan Hurt, Mar 31 2017
Sum_{n>=1} 1/a(n) = 3/4 - Pi/(4*sqrt(3)) + 3*log(3)/4. - Amiram Eldar, May 28 2022
E.g.f.: (x*(7 + 3*x)*cosh(x) + (1 + 7*x + 3*x^2)*sinh(x))/4. - Stefano Spezia, Aug 22 2023

Extensions

Entry improved by Michael Somos

A051125 Table T(n,k) = max{n,k} read by antidiagonals (n >= 1, k >= 1).

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 4, 3, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 4, 5, 6, 7, 6, 5, 4, 5, 6, 7, 8, 7, 6, 5, 5, 6, 7, 8, 9, 8, 7, 6, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 7, 8, 9, 10, 11, 12, 11, 10, 9, 8, 7, 7, 8, 9, 10, 11, 12, 13, 12, 11, 10, 9, 8, 7, 8, 9, 10, 11, 12, 13, 14, 13
Offset: 1

Views

Author

Keywords

Comments

Antidiagonal sums = A006578. - Reinhard Zumkeller, Nov 17 2011

Examples

			Table begins
  1, 2, 3, 4, 5, ...
  2, 2, 3, 4, 5, ...
  3, 3, 3, 4, 5, ...
  4, 4, 4, 4, 5, ...
  ...
		

Crossrefs

Equals A003984(n) + 1.

Programs

  • GAP
    Flat(List([1..15], n-> List([1..n], k-> Maximum(n-k+1,k) ))); # G. C. Greubel, Jul 23 2019
  • Magma
    [Max(n-k+1,k): k in [1..n], n in [1..15]]; // G. C. Greubel, Jul 23 2019
    
  • Maple
    seq(seq(max(r,d+1-r),r=1..d),d=1..15); # Robert Israel, Jul 22 2016
  • Mathematica
    Flatten[Table[Max[n-k+1, k], {n, 13}, {k, n, 1, -1}]] (* Alonso del Arte, Nov 17 2011 *)
  • PARI
    T(n,k) = max(n,k) \\ Charles R Greathouse IV, Feb 07 2017
    
  • Sage
    [[max(n-k+1,k) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Jul 23 2019
    

Formula

From Robert Israel, Jul 22 2016: (Start)
G.f. as table: G(x,y) = x*y*(1-3*x*y+x*y^2+x^2*y)/((1-x*y)*(1-x)^2*(1-y)^2).
G.f. flattened: (1-x)^(-2)*(x^2 + Sum_{j >= 0} x^(2*j^2) *(x+x^2 -2*x^(j+2)-2*x^(-j+2)+2*x^(2*j+2))). (End)

Extensions

More terms from Robert Lozyniak

A344838 Square array T(n, k), n, k >= 0, read by antidiagonals; T(n, k) = max(n * 2^max(0, w(k)-w(n)), k * 2^max(0, w(n)-w(k))) (where w = A070939).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 3, 2, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 3, 4, 5, 6, 5, 4, 3, 4, 5, 6, 7, 6, 5, 6, 6, 5, 6, 7, 8, 7, 6, 6, 4, 6, 6, 7, 8, 9, 8, 7, 6, 5, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 6, 7, 8, 9, 10, 11, 10, 9, 12, 7, 6, 6, 7, 12, 9, 10, 11, 12, 11, 10, 12, 8, 7, 6, 7, 8, 12, 10, 11, 12
Offset: 0

Views

Author

Rémy Sigrist, May 29 2021

Keywords

Comments

In other words, we right pad the binary expansion of the lesser of n and k with zeros (provided it is positive) so that both numbers have the same number of binary digits, and then take the greatest value.

Examples

			Array T(n, k) begins:
  n\k|   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
  ---+----------------------------------------------------------------
    0|   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    1|   1   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    2|   2   2   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    3|   3   3   3   3   6   6   6   7  12  12  12  12  12  13  14  15
    4|   4   4   4   6   4   5   6   7   8   9  10  11  12  13  14  15
    5|   5   5   5   6   5   5   6   7  10  10  10  11  12  13  14  15
    6|   6   6   6   6   6   6   6   7  12  12  12  12  12  13  14  15
    7|   7   7   7   7   7   7   7   7  14  14  14  14  14  14  14  15
    8|   8   8   8  12   8  10  12  14   8   9  10  11  12  13  14  15
    9|   9   9   9  12   9  10  12  14   9   9  10  11  12  13  14  15
   10|  10  10  10  12  10  10  12  14  10  10  10  11  12  13  14  15
   11|  11  11  11  12  11  11  12  14  11  11  11  11  12  13  14  15
   12|  12  12  12  12  12  12  12  14  12  12  12  12  12  13  14  15
   13|  13  13  13  13  13  13  13  14  13  13  13  13  13  13  14  15
   14|  14  14  14  14  14  14  14  14  14  14  14  14  14  14  14  15
   15|  15  15  15  15  15  15  15  15  15  15  15  15  15  15  15  15
		

Crossrefs

Cf. A344834 (AND), A344835 (OR), A344836 (XOR), A344837 (min), A344839 (absolute difference).

Programs

  • PARI
    T(n,k,op=max,w=m->#binary(m)) = { op(n*2^max(0, w(k)-w(n)), k*2^max(0, w(n)-w(k))) }

Formula

T(n, k) = T(k, n).
T(m, T(n, k)) = T(T(m, n), k).
T(n, n) = n.
T(n, 0) = n.
T(n, 1) = max(1, n).

A377930 Square array A(n, k), n, k > 0, read by antidiagonals; A(n, k) = max(A007814(n), A007814(k)).

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 2, 1, 1, 2, 0, 2, 0, 2, 0, 1, 1, 2, 2, 1, 1, 0, 1, 0, 2, 0, 1, 0, 3, 1, 1, 2, 2, 1, 1, 3, 0, 3, 0, 2, 0, 2, 0, 3, 0, 1, 1, 3, 2, 1, 1, 2, 3, 1, 1, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 2, 1, 1, 2, 3, 1, 1, 3, 2, 1, 1, 2, 0, 2, 0, 2, 0, 3, 0, 3, 0, 2, 0, 2, 0
Offset: 1

Views

Author

Rémy Sigrist, Nov 11 2024

Keywords

Comments

Let K_0 = [0], and for any m > 0, K_m is obtained by arranging four copies of K_{m-1} around a "plus" shape made of m's as follows:
+---------+---+---------+
| | m | |
| | | |
| K_{m-1} | . | K_{m-1} |
| | . | |
| | . | |
+---+ +---------+ +---------+
K_0 = | 0 |, for m > 0, K_m = |m ... m ... m|
+---+ +---------+ +---------+
| | . | |
| | . | |
| K_{m-1} | . | K_{m-1} |
| | | |
| | m | |
+---------+---+---------+
The square array A is the limit of K_m as m tends to infinity.

Examples

			Array A(n, k) begins:
    +---+---+---+---+---+---+---+
    | 0 | 1 | 0 | 2 | 0 | 1 | 0 |
    +---+   +---+   +---+   +---+
    | 1   1   1 | 2 | 1   1   1 |
    +---+   +---+   +---+   +---+
    | 0 | 1 | 0 | 2 | 0 | 1 | 0 |
    +---+---+---+   +---+---+---+
    | 2   2   2   2   2   2   2 |
    +---+---+---+   +---+---+---+
    | 0 | 1 | 0 | 2 | 0 | 1 | 0 |
    +---+   +---+   +---+   +---+
    | 1   1   1 | 2 | 1   1   1 |
    +---+   +---+   +---+   +---+
    | 0 | 1 | 0 | 2 | 0 | 1 | 0 |
    +---+---+---+---+---+---+---+
		

Crossrefs

Programs

  • Mathematica
    A[n_,k_]:=Max[IntegerExponent[n,2],IntegerExponent[k,2]]; Table[A[n-k+1,k],{n,13},{k,n}]//Flatten (* Stefano Spezia, Nov 13 2024 *)
  • PARI
    A(n, k) = max(valuation(n, 2), valuation(k, 2))

Formula

A(n, k) = A(k, n).
A(n, 0) = A(n, n) = A007814(n).
Showing 1-5 of 5 results.