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.

Previous Showing 31-39 of 39 results.

A227972 Two column recursive array A(n,k), relating expressions based on half-squares (A007590) to each other and several other sequences, read by rows.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 3, 4, 5, 7, 7, 10, 17, 24, 29, 41, 41, 58, 99, 140, 169, 239, 239, 338, 577, 816, 985, 1393, 1393, 1970, 3363, 4756, 5741, 8119, 8119, 11482, 19601, 27720, 33461, 47321, 47321, 66922, 114243, 161564, 195025, 275807, 275807, 390050, 665857, 941664, 1136689, 1607521
Offset: 1

Views

Author

Richard R. Forberg, Aug 01 2013

Keywords

Comments

The first column (k=1) holds the interleaved integer square roots of these two "Half-Square" expressions in ascending order: floor(m^2/2 + 1) for m=>0 and floor(m^2/2 - 1) for m=>1. The second column (k=2) holds the value of m that yields the corresponding integer square root.
The value of m for row n (at n mod 3 = 2) is the value of the square root for the next row (at n mod 3 = 0) which uses the other expression.
There are twice as many results for the expression floor(m^2/2 + 1) as for floor(m^2/2 - 1), interleaved consistently as two of every three results (as shown in the example below).
The first column, for n mod 3 = 1, produces A001541.
The first column, for n mod 3 = 2, produces A001653.
NOTE: Interleaving of the two sequences above is A079496.
The first column, for n mod 3 = 0, produces A002315 (NSW Numbers).
NOTE: Interleaving of A001541 and A002315 is A001333.
The second column, for n mod 3 = 1, produces A005319.
The second column, for n mod 3 = 2, produces A002315 (again).
NOTE: Interleaving of the two sequences above is A143608.
The second column, for n mod 3 = 0, produces A075870.
NOTE: Interleaving of A005319 and A075870 is A052542 = 2*A000129 (Pell)
The row sums at n mod 3 = 1 and n mod 3 = 0 are used in the recursion to produce values in subsequent rows of the array for both columns.
For rows at n mod 3 = 2, the ascending interleaved combination of A(n,1) and the row sum (of the same row) produces A000129 (Pell Numbers).
Row sums also hold all the integer square roots (as given in A001542) of the Half-Squares, (A007590), at n mod 3 = 2, and the corresponding values of m in the next row at n mod 3 = 0, corresponding to A001541.
The value of the floor of half the row sum, for n mod 3 =0 and n mod 3 = 1, produces A048739, giving the partial sums of A000129 (Pell Numbers), for the Pell Numbers produced through the prior row at n mod 3 = 2.
The value of half the row sum, for n mod 3 = 2, produces A001109 (without its initial 0). This subsequence is also produced from finding the integer square roots of A083374. The value of the indices of that sequence where these roots occur is given by A002315 (NSW Numbers).
The differences of two entries in row n equals the row sum for row n-3, consistently for all rows n > 3.
The ratio of the two entries in the same row converges to sqrt(2).
The ratio of two entries in the same column (either k=1 or k=2) converge as follows:
A(k,n)/A(k,n-1)--> sqrt(2) for n mod 3 = 0,
--> sqrt(2) + 1 for n mod 3 = 1,
--> sqrt(2)/2 + 1 for n mod 3 = 2.
A(k,n)/A(k,n-3)--> sqrt(8) + 3 for n mod 3 = 0, 1, or 2,
That last line means: A001541, A001653, A002315, A005319 and A075870 all have the convergence ratio of sqrt(8) + 3 for adjacent terms. In addition alternating Pell Numbers also converge to that ratio.

Examples

			The two column array with row number n and the row sum. An extra column on the right shows which expression is applicable to get that row's values: either floor(m^2/2 + 1) indicated as "+1",  or floor(m^2/2 - 1) indicated as "-1". (NOTE: The value of n is immaterial, except as a row number).
The array begins:
Row         k=1         k=2                   Applicable "Half-Square"
n          (sqrt)       (m)         Row Sum        Expression
1            1           0               1             +1
2            1           1               2             +1
3            1           2               3             -1
4            3           4               7             +1
5            5           7              12             +1
6            7          10              17             -1
7           17          24              41             +1
8           29          41              70             +1
9           41          58              99             -1
10          99         140             239             +1
11         169         239             408             +1
12         239         338             577             -1
13         577         816            1393             +1
14         985        1393            2378             +1
15        1393        1970            3363             -1
16        3363        4756            8119             +1
17        5741        8119           13860             +1
18        8119       11482           19601             -1
19       19601       27720           47321             +1
20       33461       47321           80782             +1
		

Crossrefs

Formula

Initialize row 1 as A(1,1) = 1 and A(1,2) = 0, then:
For rows at n mod 3 = 0: A(n,1) = A(n-1, 2)
A(n,2) = A(n, 1) + A(n-2, 1)
For rows at n mod 3 = 1: A(n,1) = A(n-1, 1) + A(n-1, 2)
A(n,2) = A(n, 1) + A(n-1, 1)
For rows at n mod 3 = 2: A(n,1) = A(n-1,1) + A(n-3, 1)
A(n,2) = A(n-1,1) + A(n-1, 2)
Empirical g.f.: -x*(2*x^11-x^10-x^9+x^8-4*x^7+3*x^6-2*x^5-x^4-x^3-x^2-1) / ((x^6-2*x^3-1)*(x^6+2*x^3-1)). - Colin Barker, Aug 08 2013

Extensions

Some additional comments by Richard R. Forberg, Aug 12 2013

A256946 Irregular triangle where n-th row is integers from 1 to n*(n+2), sorted with first squares in order, then remaining numbers by fractional part of the square root.

Original entry on oeis.org

1, 2, 3, 1, 4, 5, 2, 6, 7, 3, 8, 1, 4, 9, 10, 5, 11, 2, 6, 12, 13, 7, 3, 14, 8, 15, 1, 4, 9, 16, 17, 10, 5, 18, 11, 19, 2, 6, 12, 20, 21, 13, 7, 22, 3, 14, 23, 8, 15, 24, 1, 4, 9, 16, 25, 26, 17, 10, 27, 5, 18, 28, 11, 19, 29, 2, 6, 12, 20, 30, 31, 21, 13, 7, 32, 22, 3, 14, 33, 23, 8, 34, 15, 24, 35
Offset: 1

Views

Author

Keywords

Comments

This is a fractal sequence.
T(n,k) = T(n+1,A256507(n,k),k), that is, A256507 gives the positions of n-th's row terms in row n+1. - Reinhard Zumkeller, Apr 22 2015

Examples

			The table starts:
  1 2 3
  1 4 5 2 6 7 3 8
  1 4 9 10 5 11 2 6 12 13 7 3 14 8 15
  1 4 9 16 17 10 5 18 11 19 2 6 12 20 21 13 7 22 3 14 23 8 15 24
		

Crossrefs

Cf. A005563 (row lengths and last of each row), A083374 (row sums).
Cf. A256507.

Programs

  • Haskell
    import Data.List (sortBy); import Data.Function (on)
    a256946 n k = a256946_tabf !! (n-1) !! (k-1)
    a256946_row n = a256946_tabf !! (n-1)
    a256946_tabf = f 0 [] [] where
       f k us vs = (xs ++ ys) : f (k+1) xs ys where
         xs = us ++ qs
         ys = sortBy (compare `on`
                      snd . properFraction . sqrt . fromIntegral) (vs ++ rs)
         (qs, rs) = span ((== 1) . a010052') [k*(k+2)+1 .. (k+1)*(k+3)]
    -- Reinhard Zumkeller, Apr 22 2015
  • Mathematica
    row[n_] := SortBy[Range[n(n+2)], If[IntegerQ[Sqrt[#]], 0, N[FractionalPart[ Sqrt[#]]]]&];
    Array[row, 5] // Flatten (* Jean-François Alcover, Sep 17 2019 *)
  • PARI
    arow(n)=vecsort(vector(n*(n+2),k,if(issquare(k),0.,sqrt(k)-floor(sqrt(k)))),,1) \\ This relies on vecsort being stable.
    

A278071 Triangle read by rows, coefficients of the polynomials P(n,x) = (-1)^n*hypergeom( [n,-n], [], x), powers in descending order.

Original entry on oeis.org

1, 1, -1, 6, -4, 1, 60, -36, 9, -1, 840, -480, 120, -16, 1, 15120, -8400, 2100, -300, 25, -1, 332640, -181440, 45360, -6720, 630, -36, 1, 8648640, -4656960, 1164240, -176400, 17640, -1176, 49, -1, 259459200, -138378240, 34594560, -5322240, 554400, -40320, 2016, -64, 1
Offset: 0

Views

Author

Peter Luschny, Nov 10 2016

Keywords

Examples

			Triangle starts:
.       1,
.       1,      -1,
.       6,      -4,     1,
.      60,     -36,     9,    -1,
.     840,    -480,   120,   -16,   1,
.   15120,   -8400,  2100,  -300,  25,  -1,
.  332640, -181440, 45360, -6720, 630, -36, 1,
...
		

Crossrefs

Cf. A278069 (x=1, row sums up to sign), A278070 (x=-1).
T(n,0) = Pochhammer(n, n) (cf. A000407).
T(n,1) = -(n+1)*(2n)!/n! (cf. A002690).
T(n,2) = (n+2)*(2n+1)*(2n-1)!/(n-1)! (cf. A002691).
T(n,n-1) = (-1)^(n+1)*n^2 for n>=1 (cf. A000290).
T(n,n-2) = n^2*(n^2-1)/2 for n>=2 (cf. A083374).

Programs

  • Maple
    p := n -> (-1)^n*hypergeom([n, -n], [], x):
    ListTools:-Flatten([seq(PolynomialTools:-CoefficientList(simplify(p(n)), x, termorder=reverse), n=0..8)]);
    # Alternatively the polynomials by recurrence:
    P := proc(n,x) if n=0 then return 1 fi; if n=1 then return x-1 fi;
    ((((4*n-2)*(2*n-3)*x+2)*P(n-1,x)+(2*n-1)*P(n-2,x))/(2*n-3));
    sort(expand(%)) end: for n from 0 to 6 do lprint(P(n,x)) od;
    # Or by generalized Laguerre polynomials:
    P := (n,x) -> n!*(-x)^n*LaguerreL(n,-2*n,-1/x):
    for n from 0 to 6 do simplify(P(n,x)) od;
  • Mathematica
    row[n_] := CoefficientList[(-1)^n HypergeometricPFQ[{n, -n}, {}, x], x] // Reverse;
    Table[row[n], {n, 0, 8}] // Flatten (* Jean-François Alcover, Jul 12 2019 *)
    (* T(n,k)= *) t={};For[n=8,n>-1,n--,For[j=n+1,j>0,j--,PrependTo[t,(-1)^(j-n+1-Mod[n,2])*Product[(2*n-k)*k/(n-k+1),{k,j,n}]]]];t (* Detlef Meya, Aug 02 2023 *)

Formula

The P(n,x) are orthogonal polynomials. They satisfy the recurrence
P(n,x) = ((((4*n-2)*(2*n-3)*x+2)*P(n-1,x)+(2*n-1)*P(n-2,x))/(2*n-3)) for n>=2.
In terms of generalized Laguerre polynomials (see the Krall and Fink link):
P(n,x) = n!*(-x)^n*LaguerreL(n,-2*n,-1/x).

A143944 Triangle read by rows: T(n,k) is the number of unordered pairs of vertices at distance k from each other in the grid P_n X P_n (1 <= k <= 2n-2), where P_n is the path graph on n vertices.

Original entry on oeis.org

4, 2, 12, 14, 8, 2, 24, 34, 32, 20, 8, 2, 40, 62, 68, 60, 40, 20, 8, 2, 60, 98, 116, 116, 100, 70, 40, 20, 8, 2, 84, 142, 176, 188, 180, 154, 112, 70, 40, 20, 8, 2, 112, 194, 248, 276, 280, 262, 224, 168, 112, 70, 40, 20, 8, 2, 144, 254, 332, 380, 400, 394, 364, 312, 240
Offset: 2

Views

Author

Emeric Deutsch, Sep 19 2008

Keywords

Comments

Row n contains 2n-2 entries.
Sum of entries in row n = n^2*(n^2 - 1)/2 = A083374(n).
The entries in row n are the coefficients of the Wiener (Hosoya) polynomial of the grid P_n X P_n.
Sum_{k=1..2n-2} k*T(n,k) = n^3*(n^2 - 1)/3 = A143945(n) = the Wiener index of the grid P_n X P_n.
The average of all distances in the grid P_n X P_n is 2n/3.

Examples

			T(2,2)=2 because P_2 X P_2 is a square and there are 2 pairs of vertices at distance 2.
Triangle starts:
   4,  2;
  12, 14,  8,  2;
  24, 34, 32, 20,  8,  2;
  40, 62, 68, 60, 40, 20,  8,  2;
		

Crossrefs

Programs

  • Maple
    for n from 2 to 10 do Q[n]:=sort(expand(simplify((1/2)*(2*q*(1-q^n)-n*(1-q^2))^2/(1-q)^4-(1/2)*n^2))) end do: for n from 2 to 9 do seq(coeff(Q[n],q,j),j= 1..2*n-2) end do;

Formula

Generating polynomial of row n is (2q(1-q^n) - n(1-q^2))^2/(2(1-q)^4) - n^2/2.

A193068 Generating primitive Pythagorean triangles by using (n, n+1) gives perimeters for each n. This sequence lists the sum of these perimeters for each n triangles.

Original entry on oeis.org

12, 42, 98, 188, 320, 502, 742, 1048, 1428, 1890, 2442, 3092, 3848, 4718, 5710, 6832, 8092, 9498, 11058, 12780, 14672, 16742, 18998, 21448, 24100, 26962, 30042, 33348, 36888, 40670, 44702, 48992, 53548, 58378, 63490, 68892, 74592, 80598, 86918, 93560
Offset: 1

Views

Author

J. M. Bergot, Jul 15 2011

Keywords

Comments

Partial sums of A002939 starting at A002939(2). - R. J. Mathar, Aug 23 2011

Examples

			The perimeters of the first five triangles produced by pairs (1,2), (2,3), (3,4), (4,5), (5,6) are in order 12, 30, 56, 90, 132 with sum 320.
From the formula, a(5) = 5*(4*5^2 + 15*5 + 17)/3 = 320.
		

Crossrefs

Cf. A083374 (sum of areas for the first n triangles), A002412.

Programs

  • Magma
    I:=[12, 42, 98, 188]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..40]]; // Vincenzo Librandi, Jul 04 2012
  • Mathematica
    CoefficientList[Series[(2*(6-3*x+x^2))/((x-1)^4),{x,0,50}],x] (* Vincenzo Librandi, Jul 04 2012 *)
    LinearRecurrence[{4,-6,4,-1},{12,42,98,188},40] (* Harvey P. Dale, Oct 29 2022 *)

Formula

a(n) = n*(4*n^2 + 15*n + 17)/3.
G.f.: ( 2*x*(6-3*x+x^2) ) / ( (x-1)^4 ). - R. J. Mathar, Aug 23 2011
a(n) = 4*a(n-1) -6*a(n-2) +4*a(n-3) -a(n-4). - Vincenzo Librandi, Jul 04 2012
a(n) = 2*(A002412(n+1) - 1). - Hugo Pfoertner, Oct 22 2024

A227436 Triangle T(n, k) of the number of n X n binary matrices with k = 0..n^2 1's and no more than three 1's in the corners of any square sub-block.

Original entry on oeis.org

1, 1, 1, 4, 6, 4, 0, 1, 9, 36, 84, 121, 101, 38, 4, 0, 0, 1, 16, 120, 560, 1806, 4200, 7096, 8532, 6929, 3444, 876, 84, 2, 0, 0, 0, 0, 1, 25, 300, 2300, 12620, 52500, 170830, 441554, 910568, 1490996, 1912700, 1879432, 1368707
Offset: 1

Views

Author

Heinrich Ludwig, Jul 12 2013

Keywords

Comments

Rows are of lengths 2, 5, 10, ..., i^2+1,....
Every row starts with k = 0. For all n: T(n, 0) = 1.
The numbers are found by an exhaustive search among all (n^2, k)-combinations of 1's.
Another description of the sequence: Given a square grid with side n and n^2 points, T(n,k) is the number of ways to choose k points of the grid, so that no 4 of the chosen points form a square with sides parallel to the grid.

Examples

			T(n, k) written as a triangle
  1,1;
  1,4,6,4,0;
  1,9,36,84,121,101,38,4,0,0;
  1,16,120,560,1806,4200,7096,8532,6929,3444,876,84,2,0,0,0,0;
  ...
For n = 4 there are 2 matrices with exactly k = 12 1's so that no more than three 1's are in the corners of any square sub-block.
  [0 1 1 1]    [1 1 1 0]
  [1 1 0 1]    [1 0 1 1]
  [1 0 1 1]    [1 1 0 1]
  [1 1 1 0]    [0 1 1 1]
		

Crossrefs

Written T(n,k) as a triangle, column k = 1 gives the square numbers A000290, column k = 2 is A083374, column k = 3 is A178208.
A227133(n) is the highest index k of a number greater than zero in the n-th row.

A235367 Sum of positive even numbers up to n^2.

Original entry on oeis.org

0, 6, 20, 72, 156, 342, 600, 1056, 1640, 2550, 3660, 5256, 7140, 9702, 12656, 16512, 20880, 26406, 32580, 40200, 48620, 58806, 69960, 83232, 97656, 114582, 132860, 154056, 176820, 202950, 230880, 262656, 296480, 334662, 375156, 420552, 468540, 522006, 578360, 640800, 706440, 778806
Offset: 1

Views

Author

Réjean Labrie, Jan 07 2014

Keywords

Comments

Consider a square array of side n in which we write the integers from 1 to n in any order. This sequence gives the sum of the even numbers in the array.

Examples

			a(1) = 0 because there are no even numbers between 1 and itself.
a(2) = 6 because between 1 and 2^2 there are the even numbers 2 and 4, which add up to 6.
a(3) = 20 because between 1 and 3^2 there are the even numbers 2, 4, 6 and 8, which add up to 20.
		

Crossrefs

Programs

  • Magma
    [&+[i: i in [0..n^2 by 2]]: n in [1..50]]; // Bruno Berselli, Oct 26 2018
  • Mathematica
    Table[((n^2 - Mod[n^2, 2])/4)(n^2 + 2 - Mod[n^2, 2]), {n, 40}] (* Alonso del Arte, Jan 16 2014 *)
  • PARI
    a(n) = sum(i=1, n, i^2*(!(i % 2))); \\ Michel Marcus, Jan 18 2014
    

Formula

a(n) = (n^4 + 2n^2)/4 if n is even, a(n) = (n^4 - 1)/4 if n is odd.
a(n) = ((n^2 - (n^2 mod 2))/4)(n^2 + 2 - (n^2 mod 2)). - Alonso del Arte, Jan 16 2014
a(n) = A110660(n^2). - Michel Marcus, Jan 18 2014
G.f.: -2*x^2*(3*x^4+4*x^3+10*x^2+4*x+3) / ((x-1)^5*(x+1)^3). - Colin Barker, Jan 18 2014

Extensions

Corrected by Vincenzo Librandi, Jan 18 2014

A253284 Triangle read by rows, T(n,k) = (k+1)*(n+1)!*(n+k)!/((k+1)!^2*(n-k)!) with n >= 0 and 0 <= k <= n.

Original entry on oeis.org

1, 2, 2, 6, 18, 12, 24, 144, 240, 120, 120, 1200, 3600, 4200, 1680, 720, 10800, 50400, 100800, 90720, 30240, 5040, 105840, 705600, 2116800, 3175200, 2328480, 665280, 40320, 1128960, 10160640, 42336000, 93139200, 111767040, 69189120, 17297280
Offset: 0

Views

Author

Peter Luschny, Mar 23 2015

Keywords

Comments

G_n(x) = - Sum_{k=0..n} T(n,k)/(x-1)^(n+k+1) are generating functions, for n=0 of A000012, for n=1 of A002378, for n=2 of A083374 (with offset 0) and for n=3 for A253285. In general G_n(x) is the generating function of the sequence k -> ((n+k)!/k!)*C(n+k-1,k-1). These sequences are associated with the rows of the square array of unsigned Lah numbers (compare A253283 for the columns).

Examples

			Triangle begins:
1;
2, 2;
6, 18, 12;
24, 144, 240, 120;
120, 1200, 3600, 4200, 1680;
720, 10800, 50400, 100800, 90720, 30240;
5040, 105840, 705600, 2116800, 3175200, 2328480, 665280.
		

Crossrefs

Programs

  • Magma
    /* As triangle: */ [[(k + 1)*Factorial(n + 1)*Factorial(n + k)/(Factorial(k + 1)^2*Factorial(n - k)): k in [0..n]]: n in [0..10]]; // Bruno Berselli, Mar 23 2015
  • Maple
    T := (n,k) -> ((k+1)*(n+1)!*(n+k)!)/((k+1)!^2*(n-k)!);
    for n from 0 to 6 do seq(T(n,k), k=0..n) od;
  • Mathematica
    f[n_] := Rest@ Flatten@ Reap@ Block[{i, k, t}, For[i = 0, i <= n, i++, For[k = 0, k <= i, k++, Sow[(i + 1)!*Binomial[i + k, i]*Binomial[i, k]/(k + 1)]]]]; f@ 7 (* Michael De Vlieger, Mar 23 2015 *)
  • PARI
    tabl(nn) = {for (n=0, nn, for (k=0, n, print1((n+1)!*binomial(n+k,n)*binomial(n,k)/(k+1), ", ");); print(););} \\ Michel Marcus, Mar 23 2015
    

Formula

T(n,k) = (n+1)!*binomial(n+k,n)*binomial(n,k)/(k+1).
T(n,k) = (n+1)!*A088617(n,k).
T(n,0) = n! = A000142(n).
T(n,1) = A001804(n+1) for n>0.
T(n,n) = (2*n)!/n! = A001813(n).
Sum_{k=0..n} T(n,k) = (n+1)!*hypergeom([-n, n+1], [2], -1) = (n+1)!*A006318(n).

A157632 Triangle T(n,m) read by rows: 1 in column m=0 and on the diagonal, else 3*n*m*(n-m).

Original entry on oeis.org

1, 1, 1, 1, 6, 1, 1, 18, 18, 1, 1, 36, 48, 36, 1, 1, 60, 90, 90, 60, 1, 1, 90, 144, 162, 144, 90, 1, 1, 126, 210, 252, 252, 210, 126, 1, 1, 168, 288, 360, 384, 360, 288, 168, 1, 1, 216, 378, 486, 540, 540, 486, 378, 216, 1, 1, 270, 480, 630, 720, 750, 720, 630, 480, 270, 1
Offset: 0

Views

Author

Roger L. Bagula, Mar 03 2009

Keywords

Comments

Row sums are {1, 2, 8, 38, 122, 302, 632, 1178, 2018, 3242, 4952,...}.

Examples

			{1},
{1, 1},
{1, 6, 1},
{1, 18, 18, 1},
{1, 36, 48, 36, 1},
{1, 60, 90, 90, 60, 1},
{1, 90, 144, 162, 144, 90, 1},
{1, 126, 210, 252, 252, 210, 126, 1},
{1, 168, 288, 360, 384, 360, 288, 168, 1},
{1, 216, 378, 486, 540, 540, 486, 378, 216, 1},
{1, 270, 480, 630, 720, 750, 720, 630, 480, 270, 1}
		

Crossrefs

Programs

  • Mathematica
    t[n_, m_] = If[n*m*(n - m) == 0, 1, n^3 - (m^3 + (n - m)^3)];
    Table[Table[t[n, m], {m, 0, n}], {n, 0, 10}];
    Flatten[%]

Formula

T(n,m)= 1 if m=0 or n=m, else n^3-m^3-(n - m)^3 = 3*n*m*(n-m) =3*A157635(n,m).
Row sums: 2+A083374(n), n>0. - R. J. Mathar, Apr 10 2009

Extensions

Edited by the Associate Editors of the OEIS, Apr 10 2009
Previous Showing 31-39 of 39 results.