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

A204165 Array: row n shows the coefficients of the characteristic polynomial of the n-th principal submatrix of floor[(i+j)/2], as in A204164.

Original entry on oeis.org

1, -1, 1, -3, 1, -1, -2, 6, -1, 0, 4, 4, -10, 1, 0, 0, -15, -4, 15, -1, 0, 0, 0, 36, 3, -21, 1, 0, 0, 0, 0, -84, 4, 28, -1, 0, 0, 0, 0, 0, 160, -16, -36, 1, 0, 0, 0, 0, 0, 0, -300, 40, 45, -1, 0, 0, 0, 0, 0, 0, 0, 500, -75, -55, 1, 0, 0, 0, 0, 0, 0, 0, 0, -825, 130
Offset: 1

Views

Author

Clark Kimberling, Jan 12 2012

Keywords

Comments

Let p(n)=p(n,x) be the characteristic polynomial of the n-th principal submatrix. The zeros of p(n) are real, and they interlace the zeros of p(n+1). See A202605 and A204016 for guides to related sequences.

Examples

			Top of the array:
 1....-1
 1....-3.....1
-1....-2.....6....-1
 0.....4.....4....-10...1
		

References

  • (For references regarding interlacing roots, see A202605.)

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := Floor[(i + j)/2];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8x8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 1, 15}, {i, 1, n}]]  (* A204164 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]                 (* A204165 *)
    TableForm[Table[c[n], {n, 1, 10}]]

A204016 Symmetric matrix based on f(i,j) = max(j mod i, i mod j), by antidiagonals.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jan 10 2012

Keywords

Comments

A204016 represents the matrix M given by f(i,j) = max{(j mod i), (i mod j)} for i >= 1 and j >= 1. See A204017 for characteristic polynomials of principal submatrices of M, with interlacing zeros.
Guide to symmetric matrices M based on functions f(i,j) and characteristic polynomial sequences (c.p.s.) with interlaced zeros:
f(i,j)..........................M.........c.p.s.
C(i+j,j)........................A007318...A045912
min(i,j)........................A003983...A202672
max(i,j)........................A051125...A203989
(i+j)*min(i,j)..................A203990...A203991
|i-j|...........................A049581...A203993
max(i-j+1,j-i+1)................A143182...A203992
min(i-j+1,j-i+1)................A203994...A203995
min(i(j+1),j(i+1))..............A203996...A203997
max(i(j+1)-1,j(i+1)-1)..........A203998...A203999
min(i(j+1)-1,j(i+1)-1)..........A204000...A204001
min(2i+j,i+2j)..................A204002...A204003
max(2i+j-2,i+2j-2)..............A204004...A204005
min(2i+j-2,i+2j-2)..............A204006...A204007
max(3i+j-3,i+3j-3)..............A204008...A204011
min(3i+j-3,i+3j-3)..............A204012...A204013
min(3i-2,3j-2)..................A204028...A204029
1+min(j mod i, i mod j).........A204014...A204015
max(j mod i, i mod j)...........A204016...A204017
1+max(j mod i, i mod j).........A204018...A204019
min(i^2,j^2)....................A106314...A204020
min(2i-1, 2j-1).................A157454...A204021
max(2i-1, 2j-1).................A204022...A204023
min(i(i+1)/2,j(j+1)/2)..........A106255...A204024
gcd(i,j)........................A003989...A204025
gcd(i+1,j+1)....................A204030...A204111
min(F(i+1),F(j+1)),F=A000045....A204026...A204027
gcd(F(i+1),F(j+1)),F=A000045....A204112...A204113
gcd(L(i),L(j)),L=A000032........A204114...A204115
gcd(2^i-1,2^j-2)................A204116...A204117
gcd(prime(i),prime(j))..........A204118...A204119
gcd(prime(i+1),prime(j+1))......A204120...A204121
gcd(2^(i-1),2^(j-1))............A144464...A204122
max(floor(i/j),floor(j/i))......A204123...A204124
min(ceiling(i/j),ceiling(j/i))..A204143...A204144
Delannoy matrix.................A008288...A204135
max(2i-j,2j-i)..................A204154...A204155
-1+max(3i-j,3j-i)...............A204156...A204157
max(3i-2j,3j-2i)................A204158...A204159
floor((i+1)/2)..................A204164...A204165
ceiling((i+1)/2)................A204166...A204167
i+j.............................A003057...A204168
i+j-1...........................A002024...A204169
i*j.............................A003991...A204170
..abbreviation below: AOE means "all 1's except"
AOE f(i,i)=i....................A204125...A204126
AOE f(i,i)=A000045(i+1).........A204127...A204128
AOE f(i,i)=A000032(i)...........A204129...A204130
AOE f(i,i)=2i-1.................A204131...A204132
AOE f(i,i)=2^(i-1)..............A204133...A204134
AOE f(i,i)=3i-2.................A204160...A204161
AOE f(i,i)=floor((i+1)/2).......A204162...A204163
...
Other pairs (M, c.p.s.): (A204171, A204172) to (A204183, A204184)
See A202695 for a guide to choices of symmetric matrix M for which the zeros of the characteristic polynomials are all positive.

Examples

			Northwest corner:
  0 1 1 1 1 1 1 1
  0 1 2 2 2 2 2 2
  1 2 0 3 3 3 3 3
  1 2 3 0 4 4 4 4
  1 2 3 4 0 5 5 5
  1 2 3 4 5 0 6 6
  1 2 3 4 5 6 0 7
		

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := Max[Mod[i, j], Mod[j, i]];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8x8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
    {n, 1, 12}, {i, 1, n}]]  (* A204016 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]               (* A204017 *)
    TableForm[Table[c[n], {n, 1, 10}]]

A210530 T(n,k) = (k + 3*n - 2 - (k+n-2)*(-1)^(k+n))/2 n, k > 0, read by antidiagonals.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
Offset: 1

Views

Author

Boris Putievskiy, Jan 28 2013

Keywords

Comments

Row T(n,k) for odd n is even numbers sandwiched between n's starts from n and 2*n.
Row T(n,k) for even n is odd numbers sandwiched between n's starts from 2*n-1 and n.
Antidiagonal T(1,k), T(2,k-1), ..., T(k,1) for odd k is 1,2,3,...,k.
Antidiagonal T(1,k), T(2,k-1), ..., T(k,1) for even k is k+1, k+2, ..., 2*k+1.
The main diagonal is A000027.
Diagonal, located above the main diagonal T(1,k), T(2,k+1), T(3,k+2), ... for odd k is A000027.
Diagonal, located above the main diagonal T(1,k), T(2,k+1), T(3,k+2), ... for even k is k, k+3, k+6, ..., A016789, A016777, A008585.
Diagonal, located below the main diagonal T(n,1), T(n+1,2), T(n+2,3), ... for odd n is n,n+1, n+2, ... A000027.
Diagonal, located below the main diagonal T(n,1), T(n+1,2), T(n+2,3), ... for even n is 2*n-1, 2*n+2, 2*n+5, ... A008585, A016777, A016789.
The table contains:
A124625 as row 1,
A114753 as column 1,
A109043 as column 2,
A066104 as column 4.

Examples

			The start of the sequence as table:
   1   2   1   4   1   6   1   8   1  10
   3   2   5   2   7   2   9   2  11   2
   3   6   3   8   3  10   3  12   3  14
   7   4   9   4  11   4  13   4  15   4
   5  10   5  12   5  14   5  16   5  18
  11   6  13   6  15   6  17   6  19   6
   7  14   7  16   7  18   7  20   7  22
  15   8  17   8  19   8  21   8  23   8
   9  18   9  20   9  22   9  24   9  26
  19  10  21  10  23  10  25  10  27  10
  ...
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   1,  2,  3;
   4,  5,  6,  7;
   1,  2,  3,  4,  5;
   6,  7,  8,  9, 10, 11;
   1,  2,  3,  4,  5,  6,  7;
   8,  9, 10, 11, 12, 13, 14, 15;
   1,  2,  3,  4,  5,  6,  7,  8,  9;
  10, 11, 12, 13, 14, 15, 16, 17, 18, 19;
  ...
Row number r contains r numbers.
If r is  odd: 1,2,3,...,r.
If r is even: r, r+1, r+3, ..., 2*r-1.
The start of the sequence as array read by rows, the length of row r is 4*r-1.
First 2*r-1 numbers are from the row number 2*r-1 of triangle array, located above.
Last 2*r numbers are from the row number 2*r of triangle array, located above.
  1,2,3;
  1,2,3,4,5,6,7;
  1,2,3,4,5,6,7,8,9,10,11;
  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;
  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19;
  ...
Row number r contains 4*r-1 numbers: 1,2,3,...,4*r-1.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := (k+3n-2-(k+n-2)(-1)^(k+n))/2; Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Nov 17 2018 *)
  • PARI
    T(n,k) = (k+3*n-2-(k+n-2)*(-1)^(k+n))/2; \\ Andrew Howroyd, Jan 11 2018
    
  • Python
    t=int((math.sqrt(8*n-7)-1)/2)
    v=int((t+2)/2)
    result=n-v*(2*v-3)-1

Formula

As table T(n,k) = (k + 3*n - 2 - (k+n-2)*(-1)^(k+n))/2.
As linear sequence
a(n) = A000027(n) - A204164(n)*(2*A204164(n)-3) - 1.
a(n) = n - v*(2*v-3) - 1, where t = floor((-1 + sqrt(8*n-7))/2) and v = floor((t+2)/2).
G.f. of the table: (y*(- 1 + 3*y^2) + x^2*(2 + 5*y - 2*y^2 - 7*y^3) + x^3*(4 + y - 6*y^2 - y^3) + x*(y + 2*y^2 - y^3))/((- 1 + x)^2*(1 + x)^2*(-1 + y)^2*(1 + y)^2). - Stefano Spezia, Nov 17 2018

A370655 Triangle read by rows where row n is a block of length 4*n-1 which is a permutation of the numbers of its constituents.

Original entry on oeis.org

2, 1, 3, 4, 5, 7, 6, 8, 9, 10, 13, 14, 11, 12, 16, 15, 17, 20, 19, 18, 21, 26, 27, 24, 25, 22, 23, 29, 28, 30, 35, 32, 33, 34, 31, 36, 43, 44, 41, 42, 39, 40, 37, 38, 46, 45, 47, 54, 49, 52, 51, 50, 53, 48, 55
Offset: 1

Views

Author

Boris Putievskiy, Feb 24 2024

Keywords

Comments

Generalization of the Cantor numbering method for two adjacent diagonals. A pair of neighboring diagonals are combined into one block.
The sequence is a self-inverse permutation of natural numbers.
The sequence is an intra-block permutation of integer positive numbers.
The sequence A373498 generates the cyclic group C6 under composition. The elements of C6 are the successive compositions of A373498 with itself: A374494 = A373498(A373498) = A373498^2, A370655 = A373498^3, A374531 = A373498^4, A374447 = A373498^5. The identity element is A000027 = A373498^6. - Boris Putievskiy, Aug 03 2024

Examples

			Triangle begins:
     k = 1   2   3   4   5   6   7   8   9  10  11
  n=1:   2,  1,  3;
  n=2:   4,  5,  7,  6,  8,  9, 10;
  n=3:  13, 14, 11, 12, 16, 15, 17, 20, 19, 18, 21;
Subtracting (n-1)*(2*n-1) from each term is row n is a self-inverse permutation of 1 .. 4*n-1,
  2,1,3,
  1,2,4,3,5,6,7,
  3,4,1,2,6,5,7,10,9,8,11,
  ...
The triangle rows can be arranged as two successive upward antidiagonals in an array:
   2,  3,  7, 10, 16, 21, ...
   1,  5,  9, 12, 18, 23, ...
   4,  8, 11, 19, 22, 34, ...
   6, 14, 20, 25, 33, 40, ...
  13, 17, 24, 32, 39, 51, ...
  15, 27, 35, 42, 52, 61, ...
		

Crossrefs

Programs

  • Mathematica
    Nmax = 21;
    a[n_] := Module[{L, R, P, Result}, L = Ceiling[(Sqrt[8*n + 1] - 1)/4];
      R = n - (L - 1)*(2*L - 1);
      P = If[R < 2*L - 1, If[Mod[R, 2] == 1, -R + 2*L - 2, -R + 2*L],
        If[R == 2*L - 1, 2*L,
         If[R == 2*L, R - 1, If[Mod[R, 2] == 1, R, 6*L - R]]]];
      Result = P + (L - 1)*(2*L - 1);
      Result]
    Table[a[n], {n, 1, Nmax}]

Formula

Linear sequence:
a(n) = P(n) + (L(n)-1)*(2*L(n)-1), where L(n) = ceiling((sqrt(8*n+1)-1)/4),
L(n) = A204164(n),
R(n) = n - (L(n)-1)*(2*L(n)-1),
P(n) = -R(n) + 2*L(n)-2, if R(n) < 2*L(n) - 1 and R(n) mod 2 = 1, P(n) = -R(n) + 2*L(n), if R(n) < 2*L(n) - 1 and R(n) mod 2 = 0, P(n) = 2*L(n), if R(n) = 2*L(n) - 1, P(n) = R(n)-1, if R(n) = 2*L(n), P(n) = R(n), if R(n) > 2*L(n) and R(n) mod 2 = 1, P(n) = 6*L(n) - R(n), if R(n) > 2*L(n) and R(n) mod 2 = 0.
Triangular array T(n,k) for 1 <= k <= 4*n-1 (see Example):
T(n,k) = (n-1)*(2*n-1) + P(n,k), where
P(n,k) = 2*n-k-2 if k < 2*n-1 and k mod 2 = 1,
2*n-k if k < 2*n-1 and k mod 2 = 0,
2*k if k = 2*n-1,
k-1 if k = 2*n,
k if k > 2*n and k mod 2 = 1,
6*n-k if k > 2*n and k mod 2 = 0.

A373498 a(a(a(n))) = A370655(n).

Original entry on oeis.org

2, 1, 3, 5, 9, 7, 6, 8, 4, 10, 12, 18, 14, 20, 16, 15, 17, 13, 19, 11, 21, 23, 31, 25, 33, 27, 35, 29, 28, 30, 26, 32, 24, 34, 22, 36, 38, 48, 40, 50, 42, 52, 44, 54, 46, 45, 47, 43, 49, 41, 51, 39, 53, 37, 55
Offset: 1

Views

Author

Boris Putievskiy, Jun 17 2024

Keywords

Comments

Triangle read by rows where row n is a block of length 4*n-1 which is a permutation of the numbers of its constituents.
Generalization of the Cantor numbering method for two adjacent diagonals. A pair of neighboring diagonals are combined into one block.
The sequence is an intra-block permutation of positive integers.
The sequence A373498 generates the cyclic group C6 under composition. The elements of C6 are the successive compositions of A373498 with itself: A374494 = A373498(A373498) = A373498^2, A370655 = A373498^3, A374531 = A373498^4, A374447 = A373498^5. The identity element is A000027 = A373498^6. - Boris Putievskiy, Aug 02 2024

Examples

			Triangle begins:
     k = 1   2   3   4   5   6   7   8   9  10  11
  n=1:   2,  1,  3;
  n=2:   5,  9,  7,  6,  8,  4, 10;
  n=3:  12, 18, 14, 20, 16, 15, 17, 13, 19, 11, 21;
The triangle's rows can be arranged as two successive upward antidiagonals in an array:
   2,  3,  7, 10, 16, 21, ...
   1,  9,  4, 20, 11, 35, ...
   5,  8, 14, 19, 27, 34, ...
   6, 18, 13, 33, 24, 52, ...
  12, 17, 25, 32, 42, 51, ...
  15, 31, 26, 50, 41, 73, ...
Subtracting (n-1)*(2*n-1) from each term in row n is a permutation of 1 .. 4*n-1:
   2,1,3,
   2,6,4,3,5,1,7,
   2,8,4,10,6,5,7,3,9,1,11,
   ...
The 3rd power of each permutation is equal to the corresponding permutation in example A370655:
   (2,1,3)^3 = (2,1,3),
   (2,6,4,3,5,1,7)^3 = (1,2,4,3,5,6,7),
   (2,8,4,10,6,5,7,3,9,1,11)^3 = (3,4,1,2,6,5,7,10,9,8,11).
		

Crossrefs

Programs

  • Mathematica
    Nmax=21;
    a[n_]:=Module[{L,R,P,Result},L=Ceiling[(Sqrt[8*n+1]-1)/4];
    R=n-(L-1)*(2*L-1);
    P=Which[R<=2*L-1&&Mod[R,2]==1,R+1,R<=2*L-1&&Mod[R,2]==0,R+2*L,R>2*L-1&&Mod[R,2]==1,R,R>2*L-1&&Mod[R,2]==0,4*L-1-R];
    Result=P+(L-1)*(2*L-1);
    Result]
    Table[a[n],{n,1,Nmax}]
    Table[a[a[a[n]]],{n,1,Nmax}] (* A370655 *)

Formula

Linear sequence:
a(n) = P(n) + (L(n)-1)*(2*L(n)-1), where L(n) = ceiling((sqrt(8*n+1)-1)/4),
L(n) = A204164(n), R(n) = n - (L(n)-1)*(2*L(n)-1),
P(n) = R(n) + 1 if R(n) <= 2*L(n)-1 and R(n) mod 2 = 1, P(n) = 2*L(n) + R(n) if R(n) <= 2*L(n)-1 and R(n) mod 2 = 0, P(n) = R(n) if R(n) > 2*L(n)-1 and R(n) mod 2 = 1, P(n) = 4*L(n) - R(n) - 1 if R(n) > 2*L(n)-1 and R(n) mod 2 = 0.
Triangular array T(n,k) for 1 <= k <= 4*n-1 (see Example):
T(n,k) = (n-1)*(2*n-1) + P(n,k), where P(n,k) = k + 1 if k <= 2*n-1 and k mod 2 = 1, P(n,k) = 2*n + k if k <= 2*n-1 and k mod 2 = 0,
P(n,k) = k if k > 2*n-1 and k mod 2 = 1, P(n,k) = 4*n - k - 1 if k > 2*n-1 and k mod 2 = 0.

A374447 Inverse permutation to A373498.

Original entry on oeis.org

2, 1, 3, 9, 4, 7, 6, 8, 5, 10, 20, 11, 18, 13, 16, 15, 17, 12, 19, 14, 21, 35, 22, 33, 24, 31, 26, 29, 28, 30, 23, 32, 25, 34, 27, 36, 54, 37, 52, 39, 50, 41, 48, 43, 46, 45, 47, 38, 49, 40, 51, 42, 53, 44, 55
Offset: 1

Views

Author

Boris Putievskiy, Jul 08 2024

Keywords

Comments

Triangle read by rows where row n is a block of length 4*n-1 which is a permutation of the numbers of its constituents.
Generalization of the Cantor numbering method for two adjacent diagonals. A pair of neighboring diagonals are combined into one block.
The sequence is an intra-block permutation of positive integers.
The sequence A373498 generates the cyclic group C6 under composition. The elements of C6 are the successive compositions of A373498 with itself: A374494 = A373498(A373498) = A373498^2, A370655 = A373498^3, A374531 = A373498^4, A374447 = A373498^5. The identity element is A000027 = A373498^6. - Boris Putievskiy, Aug 03 2024

Examples

			Triangle begins:
     k = 1   2   3   4   5   6   7   8   9  10  11
  n=1:   2,  1,  3;
  n=2:   9,  4,  7,  6,  8,  5, 10;
  n=3:  20, 11, 18, 13, 16, 15, 17, 12, 19, 14, 21;
The triangle's rows can be arranged as two successive upward antidiagonals in an array:
    2,  3,  7, 10, 16, 21, ...
    1,  4,  5, 13, 14, 26, ...
    9,  8, 18, 19, 31, 34, ...
    6, 11, 12, 24, 25, 41, ...
   20, 17, 33, 32, 50, 51, ...
   15, 22, 23, 39, 40. 60, ...
Subtracting (n-1)*(2*n-1) from each term in row n is a permutation of 1 .. 4*n-1:
    2,1,3,
    6,1,4,3,5,2,7,
   10,1,8,3,6,5,7,2,9,4,11
   ...
The inverse permutation of each permutation in example A373498 is equal to the corresponding permutation above:
   (2,1,3)^(-1) = (2,1,3),
   (2,6,4,3,5,1,7)^(-1) = (6,1,4,3,5,2,7),
   (2,8,4,10,6,5,7,3,9,1,11)^(-1) = (10,1,8,3,6,5,7,2,9,4,11).
The 5th power of each permutation in example A373498 is equal to the corresponding permutation above:
   (2,1,3)^5 = (2,1,3),
   (2,6,4,3,5,1,7)^5 = (6,1,4,3,5,2,7),
   (2,8,4,10,6,5,7,3,9,1,11)^5 = (10,1,8,3,6,5,7,2,9,4,11).
		

Crossrefs

Programs

  • Mathematica
    Nmax=21;
    a[n_]:=Module[{L,R,P,Result},L=Ceiling[(Sqrt[8*n+1]-1)/4];
    R=n-(L-1)*(2*L-1); P=Which[R<=2*L&&Mod[R,2]==1,4*L-R-1,R<=2*L&&Mod[R,2]==0,R-1,R>2*L&&Mod[R,2]==1,R,R>2*L&&Mod[R,2]==0,-2*L+R];
    Result=P+(L-1)*(2*L-1);
    Result]
    Table[a[n],{n,1,Nmax}]
    Nmax=21;
    a[n_]:=Module[{L,R,P,Result},L=Ceiling[(Sqrt[8*n+1]-1)/4];
    R=n-(L-1)*(2*L-1); P=Which[R<=2*L-1&&Mod[R,2]==1,R+1,R<=2*L-1&&Mod[R,2]==0,R+2*L,R>2*L-1&&Mod[R,2]==1,R,R>2*L-1&&Mod[R,2]==0,4*L-1-R];
    Result=P+(L-1)*(2*L-1);
    Result]
    Table[a[n],{n,1,Nmax}] (* A373498 *)
    Table[a[a[a[a[a[n]]]]],{n,1,Nmax}] (* this sequence *)

Formula

Linear sequence:
a(n) = P(n) + (L(n)-1)*(2*L(n)-1), where L(n) = ceiling((sqrt(8*n+1)-1)/4),
L(n) = A204164(n), P(n) = 4*L(n) - R(n) - 1, if R(n) <= 2*L(n) and R(n) mod 2 = 1, P(n) = R(n) - 1, if R(n) <= 2*L(n) and R(n) mod 2 = 0, P(n) = R(n), if R(n) > 2*L(n) and R(n) mod 2 = 1, P(n) = - 2*L(n) + R(n), if R(n) > 2*L(n) and R(n) mod 2 = 0.
Triangular array T(n,k) for 1 <= k <= 4*n-1 (see Example):
T(n,k) = (n-1)*(2*n-1) + P(n,k), where P(n,k) = 4*n - k - 1, if k <= 2*n and k mod 2 = 1, P(n,k) = k-1, if k <= 2*n and k mod 2 = 0, P(n,k) = k, if k > 2*n and k mod 2 = 1, P(n,k) = -2*n + k, if k > 2*n and k mod 2 = 0.

A374494 a(n) = A373498(A373498(n)).

Original entry on oeis.org

1, 2, 3, 9, 4, 6, 7, 8, 5, 10, 18, 13, 20, 11, 15, 16, 17, 14, 19, 12, 21, 31, 26, 33, 24, 35, 22, 28, 29, 30, 27, 32, 25, 34, 23, 36, 48, 43, 50, 41, 52, 39, 54, 37, 45, 46, 47, 44, 49, 42, 51, 40, 53, 38, 55
Offset: 1

Views

Author

Boris Putievskiy, Jul 09 2024

Keywords

Comments

Triangle read by rows where row n is a block of length 4*n-1 which is a permutation of the numbers of its constituents.
Generalization of the Cantor numbering method for two adjacent diagonals. A pair of neighboring diagonals are combined into one block.
The sequence is an intra-block permutation of positive integers.
The sequence A373498 generates the cyclic group C6 under composition. The elements of C6 are the successive compositions of A373498 with itself: A374494 = A373498(A373498) = A373498^2, A370655 = A373498^3, A374531 = A373498^4, A374447 = A373498^5. The identity element is A000027 = A373498^6. - Boris Putievskiy, Aug 02 2024

Examples

			Triangle begins:
     k = 1   2   3   4   5   6   7   8   9  10  11
  n=1:   1,  2,  3;
  n=2:   9,  4,  6,  7,  8,  5, 10;
  n=3:  18, 13, 20, 11, 15, 16, 17, 14, 19, 12, 21;
The triangle's rows can be arranged as two successive upward antidiagonals in an array:
   1,  3,  6, 10, 15, 21, ...
   2,  4,  5, 11, 12, 22, ...
   9,  8, 20, 19, 35, 34, ...
   7, 13, 14, 24, 25, 39, ...
  18, 17, 33, 32, 52, 51, ...
  16, 26, 27, 41, 42, 60, ...
Subtracting (n-1)*(2*n-1) from each term in row n is a permutation of 1 .. 4*n-1:
   1,2,3,
   6,1,3,4,5,2,7,
   8,3,10,1,5,6,7,4,9,2,11
   ...
The 2nd power of each permutation in example A373498 is equal to the corresponding permutation above:
   (2,1,3)^2 = (1,2,3),
   (2,6,4,3,5,1,7)^2 = (6,1,3,4,5,2,7),
   (2,8,4,10,6,5,7,3,9,1,11)^2 = (8,3,10,1,5,6,7,4,9,2,11).
		

Crossrefs

Programs

  • Mathematica
    Nmax=21;
    a[n_]:=Module[{L,R,P,Result},L=Ceiling[(Sqrt[8*n+1]-1)/4];
    R=n-(L-1)*(2*L-1);
    P=Which[R<=2*L-1&&Mod[R,2]==1,R+1,R<=2*L-1&&Mod[R,2]==0,R+2*L,R>2*L-1&&Mod[R,2]==1,R,R>2*L-1&&Mod[R,2]==0,4*L-1-R];
    Result=P+(L-1)*(2*L-1);
    Result]
    Table[a[n],{n,1,Nmax}] (* A373498 *)
    Table[a[a[n]],{n,1,Nmax}] (* this sequence *)
    Nmax = 21;
    a[n_] := Module[{L, R, P, Result}, L = Ceiling[(Sqrt[8*n + 1] - 1)/4];
      R = n - (L - 1)*(2*L - 1);
      P = Which[R < 2*L - 1 && Mod[R, 2] == 1, 2*L + R + 1, R < 2*L - 1 && Mod[R, 2] == 0, 2*L - R - 1, R >= 2*L - 1 && Mod[R, 2] == 1, R, R >= 2*L - 1 && Mod[R, 2] == 0, 4*L - R];
      Result = P + (L - 1)*(2*L - 1);
      Result]
    Table[a[n], {n, 1, Nmax}]

Formula

Linear sequence:
a(n) = P(n) + (L(n)-1)*(2*L(n)-1), where L(n) = ceiling((sqrt(8*n+1)-1)/4),
L(n) = A204164(n), R(n) = n - (L(n)-1)*(2*L(n)-1), P(n) = 2*L(n) + R(n) + 1 if R(n) < 2*L(n)-1 and R(n) mod 2 = 1, P(n) = 2*L(n) - R(n) - 1 if R(n) < 2*L(n)-1 and R(n) mod 2 = 0, P(n) = R(n) if R(n) >= 2*L(n)-1 and R(n) mod 2 = 1, P(n) = 4*L(n) - R(n) if R(n) >= 2*L(n)-1 and R(n) mod 2 = 0.
Triangular array T(n,k) for 1 <= k <= 4*n-1 (see Example):
T(n,k) = (n-1)*(2*n-1) + P(n,k), where P(n,k) = 2*n + k + 1 if k < 2*n-1 and k mod 2 = 1, P(n,k) = 2*n - k - 1 if k < 2*n-1 and k mod 2 = 0, P(n,k) = k if k >= 2*n-1 and k mod 2 = 1, P(n,k) = 4*n - k if k >= 2*n-1 and k mod 2 = 0.

A374531 a(n) = A374494(A374494(n)).

Original entry on oeis.org

1, 2, 3, 5, 9, 6, 7, 8, 4, 10, 14, 20, 12, 18, 15, 16, 17, 11, 19, 13, 21, 27, 35, 25, 33, 23, 31, 28, 29, 30, 22, 32, 24, 34, 26, 36, 44, 54, 42, 52, 40, 50, 38, 48, 45, 46, 47, 37, 49, 39, 51, 41, 53, 43, 55
Offset: 1

Views

Author

Boris Putievskiy, Jul 10 2024

Keywords

Comments

Triangle read by rows where row n is a block of length 4*n-1 which is a permutation of the numbers of its constituents.
Generalization of the Cantor numbering method for two adjacent diagonals. A pair of neighboring diagonals are combined into one block.
The sequence is an intra-block permutation of positive integers.
The sequence A373498 generates the cyclic group C6 under composition. The elements of C6 are the successive compositions of A373498 with itself: A374494 = A373498(A373498) = A373498^2, A370655 = A373498^3, A374531 = A373498^4, A374447 = A373498^5. The identity element is A000027 = A373498^6. - Boris Putievskiy, Aug 02 2024

Examples

			Triangle begins:
     k = 1   2   3   4   5   6   7   8   9  10  11
  n=1:   1,  2,  3;
  n=2:   5,  9,  6,  7,  8,  4, 10;
  n=3:  14, 20, 12, 18, 15, 16, 17, 11, 19, 13, 21;
The triangle's rows can be arranged as two successive upward antidiagonals in an array:
   1,  3,  6, 10, 15, 21, ...
   2,  9,  4, 18, 13, 31, ...
   5,  8, 12, 19, 23, 34, ...
   7, 20, 11, 33, 24, 50, ...
  14, 17, 25, 32, 40, 51, ...
  16, 35, 22, 52, 39, 73, ...
Subtracting (n-1)*(2*n-1) from each term in row n is a permutation of 1 .. 4*n-1:
   1,2,3,
   2,6,3,4,5,1,7
   4,10,2,8,5,6,7,1,9,3,11
   ...
The 4th power of each permutation in example A373498 is equal to the corresponding permutation above:
   (2,1,3)^4 = (1,2,3),
   (2,6,4,3,5,1,7)^4 = (2,6,3,4,5,1,7),
   (2,8,4,10,6,5,7,3,9,1,11)^4 = (4,10,2,8,5,6,7,1,9,3,11).
		

Crossrefs

Programs

  • Mathematica
    Nmax=21;
    a[n_]:=Module[{L,R,P,Result},L=Ceiling[(Sqrt[8*n+1]-1)/4];
    R=n-(L-1)*(2*L-1);
    P=Which[R<=2*L-1&&Mod[R,2]==1,R+1,R<=2*L-1&&Mod[R,2]==0,R+2*L,R>2*L-1&&Mod[R,2]==1,R,R>2*L-1&&Mod[R,2]==0,4*L-1-R];
    Result=P+(L-1)*(2*L-1);
    Result]
    Table[a[n],{n,1,Nmax}] (* A373498(n) *)
    Table[a[a[a[a[n]]]],{n,1,Nmax}] (* this sequence *)
    Nmax=21;
    a[n_]:=Module[{L,R,P,Result},L=Ceiling[(Sqrt[8*n+1]-1)/4];
    R=n-(L-1)*(2*L-1);
    P=Which[R<2*L-1&&Mod[R,2]==1,2*L-R-1,R<2*L-1&&Mod[R,2]==0,4*L-R,R==2*L,R,R>=2*L-1&&Mod[R,2]==1,R,R>=2*L-1&&Mod[R,2]==0,-2*L+R-1];
    Result=P+(L-1)*(2*L-1);
    Result];
    Table[a[n],{n,1,Nmax}]

Formula

Linear sequence:
a(n) = P(n) + (L(n)-1)*(2*L(n)-1), where L(n) = ceiling((sqrt(8*n+1)-1)/4),
L(n) = A204164(n), R(n) = n - (L(n)-1)*(2*L(n)-1), P(n) = 2*L(n) - R(n) - 1, if R(n) < 2*L(n) - 1 and R(n) mod 2 = 1, P(n) = 4*L(n) - R(n), if R(n) < 2*L(n) - 1 and R(n) mod 2 = 0, P(n) = R(n), if R(n) = 2*L(n), P(n) = R(n), if R(n) >= 2*L(n) - 1 and R(n) mod 2 = 1, P(n) = - 2*L(n) + R(n) - 1, if R(n) >= 2*L(n) - 1 and R(n) mod 2 = 0.
a(n) = A373498(A373498(A373498(A373498(n)))). Boris Putievskiy, Aug 02 2024
Triangular array T(n,k) for 1 <= k <= 4*n-1 (see Example):
T(n,k) = (n-1)*(2*n-1) + P(n,k), where P(n,k) = 2n - k - 1, if k < 2*n-1 and k mod 2 = 1, P(n,k) = 4n - k, if k < 2*n-1 and k mod 2 = 0, P(n,k) = k, if k = 2*n, P(n,k) = k, if k >= 2*n and k mod 2 = 1, P(n,k) = - 2n + k - 1, if k >= 2*n and k mod 2 = 0.

A210521 Array read by downward antidiagonals: T(n,k) = (n+k-1)*(n+k-2) + n + floor((n+k)/2)*(1-2*floor((n+k)/2)), for n, k > 0.

Original entry on oeis.org

1, 3, 5, 2, 4, 6, 8, 10, 12, 14, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68
Offset: 1

Views

Author

Boris Putievskiy, Jan 26 2013

Keywords

Comments

Enumeration table T(n,k). The order of the list: T(1,1)=1; for k>0: T(1,2*k+1),T(1,2*k); T(2,2*k),T(2,2*k-1); ... T(2*k,2),T(2*k,1); T(2*k+1,1).
The order of the list is descent stairs from the northeast to southwest: step to the west, step to the south, step to the west and so on. The length of each step is 1 or alternation of elements pair adjacent antidiagonals.
Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.

Examples

			The start of the sequence as a table:
   1,  3,  2,  8,  7,  17,  16,  30,  29, ...
   5,  4, 10,  9, 19,  18,  32,  31,  49, ...
   6, 12, 11, 21, 20,  34,  33,  51,  50, ...
  14, 13, 23, 22, 36,  35,  53,  52,  74, ...
  15, 25, 24, 38, 37,  55,  54,  76,  75, ...
  27, 26, 40, 39, 57,  56,  78,  77, 103, ...
  28, 42, 41, 59, 58,  80,  79, 105, 104, ...
  44, 43, 61, 60, 82,  81, 107, 106, 136, ...
  45, 63, 62, 84, 83, 109, 108, 138, 137, ...
  ...
The start of the sequence as a triangular array read by rows:
   1;
   3,  5;
   2,  4,  6;
   8, 10, 12, 14;
   7,  9, 11, 13, 15;
  17, 19, 21, 23, 25, 27;
  16, 18, 20, 22, 24, 26, 28;
  30, 32, 34, 36, 38, 40, 42, 44;
  29, 31, 33, 35, 37, 39, 41, 43, 45;
  ...
The sequence as array read by rows, the length of row r is 4*r-1. First 2*r-1 numbers are from row 2*r-1 of the triangular array above. Last 2*r numbers are from row 2*r of the triangular array. The start of the sequence:
1,3,5;
2,4,6,8,10,12,14;
7,9,11,13,15,17,19,21,23,25,27;
16,18,20,22,24,26,28,30,32,34,36,38,40,42,44;
29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65;
...
Row r contains 4*r-1 numbers: 2*r^2-5*r+4, 2*r^2-5*r+6, 2*r^2-5*r+8, ..., r*(2*r+3).
Considered as a triangle, the rows have constant parity.
		

Crossrefs

Cf. A000027, A204164, the main diagonal is A084849.

Programs

  • Mathematica
    T[n_, k_] := (n+k-1)(n+k-2) + 2n + Floor[(n+k)/2](1 - 2 Floor[(n+k)/2]);
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 03 2018 *)
  • Python
    t=int((math.sqrt(8*n-7)-1)/2)
    v=int((t+2)/2)
    result=2*n+v*(1-2*v)

Formula

As a table: T(n,k) = (n+k-1)*(n+k-2) + 2*n + floor((n+k)/2)*(1-2*floor((n+k)/2)).
As a linear sequence: a(n) = 2*A000027(n) + A204164(n)*(1-2*A204164(n)).
a(n) = 2*n+v*(1-2*v), where t = floor((-1+sqrt(8*n-7))/2) and v = floor((t+2)/2).
G.f. as a table: (2 - 2*y - 5*y^2 + 6*y^3 + 3*y^4 + x*y*(1 + 3*y-5*y^2 + y^3) + x^2*(- 3 + 7*y + 5*y^2 - 11*y^3 - 6*y^4) - x^3*(- 4 + 5*y + 7*y^2 - 9*y^3 + y^4) + x^4*(1 - y - 4*y^2 + y^3 + 7*y^4))/((- 1 + x)^3*(1 + x)^2*(- 1 + y)^3*(1 + y)^2). - Stefano Spezia, Dec 03 2018

A168258 Triangle read by rows, A101688 * A000012 as infinite lower triangular matrices.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Nov 21 2009

Keywords

Comments

Row sums = A001318, general pentagonal numbers: (1, 2, 5, 12, 15, 22, ...).
Eigensequence of the triangle = A168259: (1, 2, 6, 14, 38, 96, 254, 656, ...).
The operation A101688 * A000012 transforms rows of A101688 into sequence terms by taking partial sums from the right of A101688 rows. For example, row 3 of A101688 (0, 0, 1, 1) becomes (2, 2, 2, 1). - Gary W. Adamson, Nov 15 2022

Examples

			First few rows of the triangle:
  1;
  1, 1;
  2, 2, 1;
  2, 2, 2, 1;
  3, 3, 3, 2, 1;
  3, 3, 3, 3, 2, 1;
  4, 4, 4, 4, 3, 2, 1;
  4, 4, 4, 4, 4, 3, 2, 1;
  5, 5, 5, 5, 5, 4, 3, 2, 1;
  5, 5, 5, 5, 5, 5, 4, 3, 2, 1;
  6, 6, 6, 6, 6, 6, 5, 4, 3, 2, 1;
  6, 6, 6, 6, 6, 6, 6, 5, 4, 3, 2, 1;
  7, 7, 7, 7, 7, 7, 7, 6, 5, 4, 3, 2, 1;
  7, 7, 7, 7, 7, 7, 7, 7, 6, 5, 4, 3, 2, 1;
  8, 8, 8, 8, 8, 8, 8, 8, 7, 6, 5, 4, 3, 2, 1;
  ...
		

Crossrefs

Programs

  • PARI
    T(n, k) = if(binomial(k, n-k)>0, 1, 0); \\ A101688
    lista(nn) = my(ma=matrix(nn+1, nn, n, k, T(n-1, k-1)), mb=matrix(nn, nn, n, k, n>=k)); my(m=ma*mb, list=List()); for (n=1, nn, listput(list, vector(n, k, m[n,k]))); Vec(list); \\ Michel Marcus, Nov 16 2022

Formula

Triangle read by rows, A101688 * A000012 as infinite lower triangular matrices.
a(n) = min(A004736, A204164); a(n) = min(j, floor((t+2)/2)), where j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Apr 18 2013

Extensions

Name corrected by Gary W. Adamson, Nov 15 2022
Showing 1-10 of 10 results.