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 23 results. Next

A203993 Array: row n shows the coefficients of the characteristic polynomial of the n-th principal submatrix of {|i-j}, (A049581).

Original entry on oeis.org

0, -1, -1, 0, 1, 4, 6, 0, -1, -12, -32, -20, 0, 1, 32, 120, 140, 50, 0, -1, -80, -384, -648, -448, -105, 0, 1, 192, 1120, 2464, 2520, 1176, 196, 0, -1, -448, -3072, -8320, -11264, -7920, -2688, -336, 0, 1, 1024, 8064, 25920, 43680
Offset: 1

Views

Author

Clark Kimberling, Jan 09 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 for a guide to related sequences.
Also the coefficients of the detour and distance polynomials of the n-path graph P_n. - Eric W. Weisstein, Apr 07 2017
p(n,x) = (-x)^n*(x*(1 + T(n, 1+1/x)) - n*S(n-1, 2*(1+1/x)))/(2*x), with the Chebyshev polynomials S (A049310) and T (A053120). This is the rewritten formula given below in the Mathematica program by Weisstein. - Wolfdieter Lang, Feb 02 2018

Examples

			The array T (a table if row n=0 is by convention put to 0) begins:
n\k     0      1      2       3       4       5      6      7     8    9  10 ...
(0:     0)
1:      0     -1
2:     -1      0      1
3:      4      6      0      -1
4:    -12    -32    -20       0       1
5:     32    120    140      50       0      -1
6:    -80   -384   -648    -448    -105       0      1
7:    192   1120   2464    2520    1176     196      0     -1
8:   -448  -3072  -8320  -11264   -7920   -2688   -336      0     1
9:   1024   8064  25920   43680   41184   21384   5544    540     0   -1
10: -2304 -20480 -76160 -153600 -182000 -128128 -51480 -10560  -825    0   1
... reformatted and extended. - _Wolfdieter Lang_, Feb 02 2018
		

References

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

Crossrefs

Cf. A049310, A049581, A053120, A085750 (column k=0, Det(M_n)), A166445(n-1) (alternating row sums), A202605.

Programs

  • Mathematica
    (* begin*)
    f[i_, j_] := Abs[i - j];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[6]] (* 6x6 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
    {n, 1, 12}, {i, 1, n}]]  (* A049581 *)
    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[%]    (* A203993 *)
    TableForm[Table[c[n], {n, 1, 10}]]
    (* end *)
    CoefficientList[Table[CharacteristicPolynomial[SparseArray[{i_, j_} :> Abs[i - j], n], x], {n, 10}], x] //Flatten (* Eric W. Weisstein, Apr 07 2017 *)
    CoefficientList[Table[((-x)^n (x + x ChebyshevT[2 n, Sqrt[1 + 1/(2 x)]] - n ChebyshevU[n - 1, 1 + 1/x]))/(2 x), {n, 10}], x] // Flatten (* Eric W. Weisstein, Apr 07 2017 *)
    CoefficientList[Table[1/4 (2 (-x)^n + (-1 - x - Sqrt[1 + 2 x])^n + (-1 - x + Sqrt[1 + 2 x])^n + (n (-(-1 - x - Sqrt[1 + 2 x])^n + (-1 - x + Sqrt[1 + 2 x])^n))/Sqrt[1 + 2 x]), {n, 10}], x] // Flatten (* Eric W. Weisstein, Apr 07 2017 *)
    CoefficientList[LinearRecurrence[{-4 - 5 x, -2 (2 + 6 x + 5 x^2), -2 x (2 + 6 x + 5 x^2), -x^3 (4 + 5 x), -x^5}, {-x, (-1 + x) (1 + x), -(2 + x) (-2 - 2 x + x^2), (-6 - 4 x + x^2) (2 + 4 x + x^2), -(4 + 6 x + x^2) (-8 - 18 x - 6 x^2 + x^3)}, 10], x] // Flatten (* Eric W. Weisstein, Apr 07 2017 *)

Formula

T(n, k) = [x^k] p(n,x), with p(n,x) = Determinant(M_n - x*1_n), with the n x n matrix M_n with entries M_n(i, j) = |i-j|, for n >= 1, k = 0, 1, ..., n. For p(n,x) see a comment above and the Mathematica formulas by Weisstein.- Wolfdieter Lang, Feb 02 2018

A003991 Multiplication table read by antidiagonals: T(i,j) = i*j, i>=1, j>=1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Or, triangle X(n,m) = T(n-m+1,m) read by rows, in which row n gives the numbers n*1, (n-1)*2, (n-2)*3, ..., 2*(n-1), 1*n.
Radius of incircle of Pythagorean triangle with sides a=(n+1)^2-m^2, b=2*(n+1)*m and c=(n+1)^2+m^2. - Floor van Lamoen, Aug 16 2001
A permutation of A061017. - Matthew Vandermast, Feb 28 2003
In the proof of countability of rational numbers they are arranged in a square array. a(n) = p*q where p/q is the corresponding rational number as read from the array. - Amarnath Murthy, May 29 2003
Permanent of upper right n X n corner is A000442. - Marc LeBrun, Dec 11 2003
Row 12 gives total number of partridges, turtle doves, ... and drummers drumming that you have received at the end of the Twelve Days of Christmas song. - Alonso del Arte, Jun 17 2005
Consider a particle with spin S (a half-integer) and 2S+1 quantum states |m>, m = -S,-S+1,...,S-1,S. Then the matrix element = sqrt((S+m+1)(S-m)) of the spin-raising operator is the square-root of the triangular (tabl) element T(r,o) of this sequence in row r = 2S, and at offset o=2(S+m). T(r,o) is also the intensity || of the transition between the states |m> and |m+1>. For example, the five transitions between the 6 states of a spin S=5/2 particle have relative intensities 5,8,9,8,5. The total intensity of all spin 5/2 transitions (relative to spin 1/2) is 35, which is the tetrahedral number A000292(5). - Stanislav Sykora, May 26 2012
Sum_{k=0..2n-2} (-1)^k*a(A000124(2n-2)+k) = n. See A098359. - Charlie Marion, Apr 22 2013
T(n, k) is also the (k-1)-superdiagonal sum of an n X n Toeplitz matrix M(n) whose first row consists of successive positive integer numbers 1, ..., n. - Stefano Spezia, Jul 12 2019
From Eric Lengyel, Jun 28 2023: (Start)
X(n, m+1) is the number of degrees of freedom that an m-dimensional flat geometry (point, line, plane, etc.) has when embedded in an n-dimensional Euclidean space.
X(n+1, m+1) is the number of degrees of freedom that an m-ball has when embedded in an n-dimensional Euclidean space. (End)
T(n, k) is also the average number of steps it takes a person to fall off a board of length n+k, if the person starts a random walk at k. - Ruediger Jehn, May 12 2025

Examples

			The array T starts in row n=1 with columns m>=1 as:
   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
   2   4   6   8  10  12  14  16  18  20  22  24  26  28  30
   3   6   9  12  15  18  21  24  27  30  33  36  39  42  45
   4   8  12  16  20  24  28  32  36  40  44  48  52  56  60
   5  10  15  20  25  30  35  40  45  50  55  60  65  70  75
   6  12  18  24  30  36  42  48  54  60  66  72  78  84  90
   7  14  21  28  35  42  49  56  63  70  77  84  91  98 105
   8  16  24  32  40  48  56  64  72  80  88  96 104 112 120
   9  18  27  36  45  54  63  72  81  90  99 108 117 126 135
  10  20  30  40  50  60  70  80  90 100 110 120 130 140 150
The triangle X(n, m) begins
   n\m  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 ...
   1:   1
   2:   2  2
   3:   3  4  3
   4:   4  6  6  4
   5:   5  8  9  8  5
   6:   6 10 12 12 10  6
   7:   7 12 15 16 15 12  7
   8:   8 14 18 20 20 18 14  8
   9:   9 16 21 24 25 24 21 16  9
  10:  10 18 24 28 30 30 28 24 18 10
  11:  11 20 27 32 35 36 35 32 27 20 11
  12:  12 22 30 36 40 42 42 40 36 30 22 12
  13:  13 24 33 40 45 48 49 48 45 40 33 24 13
  14:  14 26 36 44 50 54 56 56 54 50 44 36 26 14
  15:  15 28 39 48 55 60 63 64 63 60 55 48 39 28 15
  ... Formatted by _Wolfdieter Lang_, Dec 02 2014
		

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 46.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 5-6.

Crossrefs

Main diagonal gives squares A000290. Antidiagonal sums are tetrahedral numbers A000292. See A004247 for another version.

Programs

  • Magma
    /* As triangle */ [[k*(n-k+1): k in [1..n]]: n in [1..15]]; // Vincenzo Librandi, Jul 12 2019
  • Maple
    seq(seq(i*(n-i),i=1..n-1),n=2..10); # Robert Israel, Dec 14 2015
  • Mathematica
    Table[(x + 1 - y) y, {x, 13}, {y, x}] // Flatten (* Robert G. Wilson v, Oct 06 2007 *)
    f[n_] := Table[SeriesCoefficient[E^(x + y) (1+ x - y +x*y-y^2), {x, 0, i}, {y, 0, j}]*i!*j!, {i, n, n}, {j, 0, n}]; Flatten[Array[f, 11,0]] (* Stefano Spezia, Jul 12 2019 *)
  • PARI
    A003991(n,k) = if(k<1 || n<1,0,k*n)
    

Formula

Rectangular array: T(n, m) = n*m, n>=1, m>= 1.
Triangle X(n, m) = T(n-m+1, m) = (n-m+1)*m.
Sum_{i=1..n} Sum_{j=1..n} a(n) = A000537(n) [Sum of first n cubes; or n-th triangular number squared.] Determinant of all n X n contiguous subarrays of A003991 is 0. - Gerald McGarvey, Sep 26 2004
G.f. as rectangular array: x*y/((1 - x)^2*(1 - y)^2).
a(n) = i*j, where i=floor((1+sqrt(8n-7))/2), j=n-i*(i-1)/2. - Hieronymus Fischer, Aug 08 2007
As an infinite lower triangular matrix equals A000012 * A002260; where A000012 = (1; 1,1; 1,1,1; ...) and A002260 = (1; 1,2; 1,2,3; ...). - Gary W. Adamson, Oct 23 2007
As a linear array, the sequence is a(n) = A002260(n)*A004736(n) or a(n) = ((t*t+3*t+4)/2-n)*(n-(t*(t+1)/2)), where t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 17 2012
G.f. as linear array: (x - 3*x^2 + Sum_{k >= 0} ((k+2-x-(k+1)*x^2)*x^((k^2+3*k+4)/2)))/(1-x)^3. - Robert Israel, Dec 14 2015
E.g.f. as triangle: exp(x+y)*(1 + x - y + x*y - y^2). - Stefano Spezia, Jul 12 2019
a(n) = (1/2)*t + (n - 1/4)*t^2 - (1/4)*t^4 - n^2 + n, where t = floor(sqrt(2*n) + 1/2). - Ridouane Oudra, Nov 21 2020
a(n) = A003989(n) * A003990(n) = A059895(n) * A059896(n) = A059895(n)^2 * A059897(n). - Antti Karttunen, Dec 13 2021
T(n,k) = A002620(n+k) - A002620(n-k). - Michel Marcus, Jan 06 2023
T(n,k) = number of sums |x-y|+|y-z| = k, where x,y,z are in {1,2,...,n} and x < y < z. - Clark Kimberling, Jan 22 2024
E.g.f. as rectangular array: x*y*exp(x+y). - Stefano Spezia, Jun 27 2025

Extensions

More terms from Michael Somos

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}]]

A053615 Pyramidal sequence: distance to nearest product of two consecutive integers (promic or heteromecic numbers).

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 20 2000

Keywords

Comments

a(A002378(n)) = 0; a(n^2) = n.
Table A049581 T(n,k) = |n-k| read by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). - Boris Putievskiy, Jan 29 2013

Examples

			a(10) = |10 - 3*4| = 2.
From _Boris Putievskiy_, Jan 29 2013: (Start)
The start of the sequence as table:
  0, 1, 2, 3, 4, 5, 6, 7, ...
  1, 0, 1, 2, 3, 4, 5, 6, ...
  2, 1, 0, 1, 2, 3, 4, 5, ...
  3, 2, 1, 0, 1, 2, 3, 4, ...
  4, 3, 2, 1, 0, 1, 2, 3, ...
  5, 4, 3, 2, 1, 0, 1, 2, ...
  6, 5, 4, 3, 2, 1, 0, 1, ...
  ...
The start of the sequence as triangle array read by rows:
  0;
  1, 0, 1;
  2, 1, 0, 1, 2;
  3, 2, 1, 0, 1, 2, 3;
  4, 3, 2, 1, 0, 1, 2, 3, 4;
  5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5;
  6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6;
  7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7;
  ...
Row number r contains 2*r-1 numbers: r-1, r-2, ..., 0, 1, 2, ..., r-1. (End)
		

Crossrefs

Programs

  • Maple
    A053615 := proc(n)
        A004738(n+1)-1 ; # reuses code of A004738
    end proc:
    seq(A053615(n),n=0..30) ; # R. J. Mathar, Feb 14 2019
  • Mathematica
    a[0] = 0; a[n_] := Floor[Sqrt[n]] - a[n - Floor[Sqrt[n]]]; Table[a[n], {n, 0, 103}] (* Jean-François Alcover, Dec 16 2011, after Benoit Cloitre *)
    Join[{0},Module[{nn=150,ptci},ptci=Times@@@Partition[Range[nn/2+1],2,1];Table[Abs[n-Nearest[ptci,n]],{n,nn}][[All,1]]]] (* Harvey P. Dale, Aug 29 2020 *)
  • PARI
    a(n)=sqrtint(n)-a(n-sqrtint(n))
    
  • PARI
    apply( {A053615(n)=(t=sqrt(n)\/1)-abs(t^2-n)}, [0..99]) \\ M. F. Hasler, Feb 01 2025
    
  • Python
    A053615 = lambda n: (t := round(n**.5)) - abs(t**2 - n) # M. F. Hasler, Feb 01 2025
    
  • Python
    from math import isqrt
    def A053615(n): return abs((t:=isqrt(n))*(t+1)-n) # Chai Wah Wu, Mar 01 2025

Formula

a(n) = A004738(n+1) - 1.
Let u(1)=1, u(n) = n - u(n-sqrtint(n)) (cf. A037458); then a(0)=0 and for n > 0 a(n) = 2*u(n) - n. - Benoit Cloitre, Dec 22 2002
a(0)=0 then a(n) = floor(sqrt(n)) - a(n - floor(sqrt(n))). - Benoit Cloitre, May 03 2004
a(n) = |A196199(n)|. a(n) = |n - t^2 - t|, where t = floor(sqrt(n)). - Boris Putievskiy, Jan 29 2013 [corrected by Ridouane Oudra, May 11 2019]
a(n) = A000194(n) - A053188(n) = t - |t^2 - n|, where t = floor(sqrt(n)+1/2). - Ridouane Oudra, May 11 2019

A114327 Table T(n,m) = n - m read by upwards antidiagonals.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

From Clark Kimberling, May 31 2011: (Start)
If we arrange A000027 as an array with northwest corner
1 2 4 7 17 ...
3 5 8 12 18 ...
6 9 13 18 24 ...
10 14 19 25 32 ...
diagonals can be numbered as follows depending on their distance to the main diagonal:
Diag 0: 1, 5, 13, 25, ...
Diag 1: 2, 8, 18, 32, ...
Diag -1: 3, 9, 19, 33, ...,
then a(n) in the flattened array is the number of the diagonal that contains n+1. (End)
Construct the infinite-dimensional matrix representation of angular momentum operators (J_1,J_2,J_3) in Jordan-Schwinger form (cf. Harter, Klee, Schwinger). Triangle terms T(n,k) = T(2j,j-m) satisfy: (1/2) T(2j,j-m) = = m. Matrix J_3 is diagonal, so this equality determines the only nonzero entries. - Bradley Klee, Jan 29 2016
For the characteristic polynomial of the n X n matrix M_n (Det(x*1_n - M_n)) with elements M_n(i, j) = i-j see the Michael Somos, Nov 14 2002, comment on A002415. - Wolfdieter Lang, Feb 05 2018
The entries of the n-th antidiagonal, T(n,1), T(n-1,2), ... , T(1,n), are the eigenvalues of the Hamming graph H(2,n-1) (or hypercube Q(n-1)). - Miquel A. Fiol, May 21 2024

Examples

			From _Wolfdieter Lang_, Feb 05 2018: (Start)
The table T(n, m) begins:
  n\m 0  1  2  3  4  5 ...
  0:  0 -1 -2 -3 -4 -5 ...
  1:  1  0 -1 -2 -3 -4 ...
  2:  2  1  0 -1 -2 -3 ...
  3:  3  2  1  0 -1 -2 ...
  4:  4  3  2  1  0 -1 ...
  5:  5  4  3  2  1  0 ...
  ...
The triangle t(n, k) begins:
  n\k  0  1  2  3  4  5  6  7  8  9  10 ...
  0:   0
  1:   1 -1
  2:   2  0 -2
  3:   3  1 -1 -3
  4:   4  2  0 -2 -4
  5:   5  3  1 -1 -3 -5
  6:   6  4  2  0 -2 -4 -6
  7:   7  5  3  1 -1 -3 -5 -7
  8:   8  6  4  2  0 -2 -4 -6 -8
  9:   9  7  5  3  1 -1 -3 -5 -7 -9
  10: 10  8  6  4  2  0 -2 -4 -6 -8 -10
  ... Reformatted and corrected. (End)
		

Crossrefs

Apart from signs, same as A049581. Cf. A003056, A025581, A002262, A002260, A004736. J_1,J_2: A094053; J_1^2,J_2^2: A141387, A268759. A002415.

Programs

  • Haskell
    a114327 n k = a114327_tabl !! n !! k
    a114327_row n = a114327_tabl !! n
    a114327_tabl = zipWith (zipWith (-)) a025581_tabl a002262_tabl
    -- Reinhard Zumkeller, Aug 09 2014
    
  • Maple
    seq(seq(i-2*j,j=0..i),i=0..30); # Robert Israel, Jan 29 2016
  • Mathematica
    max = 12; a025581 = NestList[Prepend[#, First[#]+1]&, {0}, max]; a002262 = Table[Range[0, n], {n, 0, max}]; a114327 = a025581 - a002262 // Flatten (* Jean-François Alcover, Jan 04 2016 *)
    Flatten[Table[-2 m, {j, 0, 10, 1/2}, {m, -j, j}]] (* Bradley Klee, Jan 29 2016 *)
  • PARI
    T(n,m) = n-m \\ Charles R Greathouse IV, Feb 07 2017
    
  • Python
    from math import isqrt
    def A114327(n): return ((m:=isqrt(k:=n+1<<1))+(k>m*(m+1)))**2+1-k # Chai Wah Wu, Nov 09 2024

Formula

G.f. for the table: Sum_{n, m>=0} T(n,m)*x^n*y^n = (x-y)/((1-x)^2*(1-y)^2).
E.g.f. for the table: Sum_{n, m>=0} T(n,m)x^n/n!*y^m/m! = (x-y)*e^{x+y}.
T(n,k) = A025581(n,k) - A002262(n,k).
a(n+1) = A004736(n) - A002260(n) or a(n+1) = ((t*t+3*t+4)/2-n) - (n-t*(t+1)/2), where t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 24 2012
G.f. as sequence: -(1+x)/(1-x)^2 + Sum_{j>=0} (2*j+1)*x^(j*(j+1)/2) / (1-x). The sum is related to Jacobi theta functions. - Robert Israel, Jan 29 2016
Triangle t(n, k) = n - 2*k, for n >= 0, k = 0..n. (see the Maple program). - Wolfdieter Lang, Feb 05 2018

Extensions

Formula improved by Reinhard Zumkeller, Aug 09 2014

A143182 Triangle T(n,m) = 1 + abs(n-2*m), read by rows, 0<=m<=n.

Original entry on oeis.org

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

Views

Author

Roger L. Bagula and Gary W. Adamson, Oct 17 2008

Keywords

Comments

From Boris Putievskiy, Jan 15 2013: (Start)
General case see A187760. Let m be natural number. Table T(n,k) n, k > 0, T(n,k)=n-k+1, if n>=k, T(n,k)=k-n+m-1, if n < k. Table T(n,k) read by antidiagonals. The first column of the table T(n,1) is the sequence of the natural numbers A000027. In all columns with number k (k > 1) the segment with the length of (k-1): {m+k-2, m+k-3, ..., m} shifts the sequence A000027. For m=1 the result is A220073, for m=2 the result is A143182. (End)

Examples

			From _Boris Putievskiy_, Jan 15 2013: (Start)
The start of the sequence as table:
1...2...3...4...5...6...7...8...9..10..11...
2...1...2...3...4...5...6...7...8...9..10...
3...2...1...2...3...4...5...6...7...8...9...
4...3...2...1...2...3...4...5...6...7...8...
5...4...3...2...1...2...3...4...5...6...7...
6...5...4...3...2...1...2...3...4...5...6...
7...6...5...4...3...2...1...2...3...4...5...
8...7...6...5...4...3...2...1...2...3...4...
9...8...7...6...5...4...3...2...1...2...3...
10..9...8...7...6...5...4...3...2...1...2...
11.10...9...8...7...6...5...4...3...2...1...
. . .
The start of the sequence as triangle array read by rows: (End)
   1;
   2, 2;
   3, 1, 3;
   4, 2, 2, 4;
   5, 3, 1, 3, 5;
   6, 4, 2, 2, 4, 6;
   7, 5, 3, 1, 3, 5, 7;
   8, 6, 4, 2, 2, 4, 6, 8;
   9, 7, 5, 3, 1, 3, 5, 7, 9;
  10, 8, 6, 4, 2, 2, 4, 6, 8, 10;
  11, 9, 7, 5, 3, 1, 3, 5, 7,  9, 11;
. . .
Row number r contains r numbers: r, r-2,...3,1,3,...r-2,r if r is odd,
r, r-2,...2,2,...r-2,r, if r is even. - _Boris Putievskiy_, Jan 15 2013
		

Crossrefs

Cf. A049581 (subtract 1's), A074148 (row sums), A000027, A220073, A187760.

Programs

  • GAP
    Flat(List([0..15], n-> List([0..n], k-> 1+AbsInt(n-2*k) ))); # G. C. Greubel, Jul 23 2019
  • Magma
    [1+Abs(n-2*k): k in [0..n], n in [0..15]]; // G. C. Greubel, Jul 23 2019
    
  • Mathematica
    T[n_, m_]:= 1+Abs[(1+n-m) - (1+m)]; Table[Table[t[n, m], {m,0,n}], {n, 0, 15}]//Flatten
  • PARI
    for(n=0,15, for(k=0,n, print1(1+abs(n-2*k), ", "))) \\ G. C. Greubel, Jul 23 2019
    
  • Sage
    [[1+abs(n-2*k) for k in (0..n)] for n in (0..15)] # G. C. Greubel, Jul 23 2019
    

Formula

Symmetry: T(n,m) = T(n,n-m).
From Boris Putievskiy, Jan 15 2013: (Start)
For the general case
a(n) = |(t+1)^2 - 2n| + m*floor((t^2+3t+2-2n)/(t+1)),
where t = floor((-1+sqrt(8*n-7))/2).
For m = 2
a(n) = |(t+1)^2 - 2n| + 2*floor((t^2+3t+2-2n)/(t+1)),
where t=floor((-1+sqrt(8*n-7))/2). (End)

Extensions

Offset and row sums corrected by R. J. Mathar, Jul 05 2012

A053616 Pyramidal sequence: distance to nearest triangular number.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 20 2000

Keywords

Comments

From Wolfdieter Lang, Oct 24 2020: (Start)
If this sequence is written with offset 1 as a number triangle T(n, k), with n the length of row n, for n >= 1, then row n gives the primitive period of the periodic sequence {k (mod* n)}_{k>=0}, where k (mod* n) = k (mod n) if k <= floor(n/2) and otherwise it is -k (mod n). Such a modified modular relation mod* n has been used by Brändli and Beyne, but for integers relative prime to n.
These periodic sequences are given in A000007, A000035, A011655, A007877, |A117444|, A260686, A279316, for n = 1, 2, ..., 7. For n = 10 A271751, n = 12 A271832, n = 14 A279313. (End)

Examples

			a(12) = |12 - 10| = 2 since 10 is the nearest triangular number to 12.
From _M. F. Hasler_, Dec 06 2019: (Start)
Ignoring a(0) = 0, the sequence can be written as triangle indexed by m >= k >= 1, in which case the terms are (m - |k - |m-k||)/2, as follows:
   0,      (Row 0: ignore)
   0,      (Row m=1, k=1: For k=m, m - |k - |m-k|| = m - |m - 0| = 0.)
   1, 0,        (Row m=2: for k=1, |m-k| = 1, k-|m-k| = 0, m-0 = 2, (...)/2 = 1.)
   1, 1, 0,
   1, 2, 1, 0,    (Row m=4: for k=2, we have twice the value of (m=2, k=1) => 2.)
   1, 2, 2, 1, 0,
   (...)
This is related to the non-associative operation A049581(x,y) = |x - y| =: x @ y. Specifically, @ is commutative and any x is its own inverse, so non-associativity of @ can be measured through the commutator ((x @ y) @ y) @ x which equals twice the element indexed {m,k} = {x,y} in the above triangle.
(End)
		

Crossrefs

a(n) = abs(A305258(n)).

Programs

  • Mathematica
    a[n_] := (k =.; k = Reduce[k > 0 && k*(k+1)/2 == n, Reals][[2]] // Floor; Min[(k+1)*(k+2)/2 - n, n - k*(k+1)/2]); Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Jan 08 2013 *)
    Module[{trms=120,t},t=Accumulate[Range[Ceiling[(Sqrt[8*trms+1]-1)/2]]]; Join[{0},Flatten[Table[Abs[Nearest[t,n][[1]]-n],{n,trms}]]]] (* Harvey P. Dale, Nov 08 2013 *)
  • PARI
    print1(x=0, ", ");for(stride=1,13,x+=stride;y=x+stride+1;for(k=x,y-1,print1(min(k-x,y-k), ", "))) \\ Hugo Pfoertner, Jun 02 2018
    
  • PARI
    apply( {a(n)=if(n,-abs(n*2-(n=sqrtint(8*n-7)\/2)^2)+n)\2}, [0..40]) \\ same as (i - |j - |i-j||)/2 with i=sqrtint(8*n-7)\/2, j=n-i(i-1)/2. - M. F. Hasler, Dec 06 2019
    
  • Python
    from math import isqrt
    def A053616(n): return abs((m:=isqrt(k:=n<<1))*(m+1)-k)>>1 # Chai Wah Wu, Jul 15 2022

Formula

a(n) = (x - |y - |x-y||)/2, when (x,y) is the n-th element in the triangle x >= y >= 1. - M. F. Hasler, Dec 06 2019
a(n) = (1/2)*abs(t^2 + t - 2*n), where t = floor(sqrt(2*n)) = A172471. - Ridouane Oudra, Dec 15 2021
From Ctibor O. Zizka, Nov 12 2024: (Start)
For s >= 1, t from [0, s] :
a(2*s^2 + t) = s - t.
a(2*s^2 - t) = s - t.
a(2*s^2 + 2*s - t) = s - t.
a(2*s^2 + 2*s + 1 + t) = s - t. (End)

A003988 Triangle with subscripts (1,1),(2,1),(1,2),(3,1),(2,2),(1,3), etc. in which entry (i,j) is [ i/j ].

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Another version of A010766.

Crossrefs

Row sums are in A006218. Antidiagonal sums are in A002541.

Programs

  • Haskell
    a003988 n k = (n + 1 - k) `div` k
    a003988_row n = zipWith div [n,n-1..1] [1..n]
    a003988_tabl = map a003988_row [1..]
    -- Reinhard Zumkeller, Apr 13 2012
  • Mathematica
    t[n_, k_] := Quotient[n, k]; Table[t[n-k+1, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 21 2013 *)

Formula

From Franklin T. Adams-Watters, Jan 28 2006: (Start)
T(n,k) = Sum_{i=1..k} A077049(n,i).
G.f.: (1/(1-x))*Sum_{k>0} x^k*y^k/(1-x^k) = (1/(1-x))*Sum_{k>0} x^k * y / (1 - x^k y) = (1/(1-x)) * Sum_{k>0} x^k * Sum_{d|k} y^d = A(x,y)/(1-x) where A(x,y) is the g.f. of A077049. (End)
T(n,k) = floor((n + 1 - k) / k). - Reinhard Zumkeller, Apr 13 2012

Extensions

More terms from James Sellers

A089913 Table T(n,k) = lcm(n,k)/gcd(n,k) = n*k/gcd(n,k)^2 read by antidiagonals (n >= 1, k >= 1).

Original entry on oeis.org

1, 2, 2, 3, 1, 3, 4, 6, 6, 4, 5, 2, 1, 2, 5, 6, 10, 12, 12, 10, 6, 7, 3, 15, 1, 15, 3, 7, 8, 14, 2, 20, 20, 2, 14, 8, 9, 4, 21, 6, 1, 6, 21, 4, 9, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 11, 5, 3, 2, 35, 1, 35, 2, 3, 5, 11, 12, 22, 30, 36, 40, 42, 42, 40, 36, 30, 22, 12, 13, 6, 33, 10, 45
Offset: 1

Views

Author

Marc LeBrun, Nov 14 2003

Keywords

Comments

A multiplicative analog of absolute difference A049581. Exponents in prime factorization of T(n,k) are absolute differences of those of n and k. Commutative non-associative operator with identity 1. T(nx,kx)=T(n,k), T(n^x,k^x)=T(n,k)^x, etc.
The bivariate function log(T(., .)) is a distance (or metric) function. It is a weighted analog of A130836, in the sense that if e_i (resp. f_i) denotes the exponent of prime p_i in the factorization of m (resp. of n), then both log(T(m, n)) and A130836(m, n) are writable as Sum_{i} w_i * abs(e_i - f_i). For A130836, w_i = 1 for all i, whereas for log(T(., .)), w_i = log(p_i). - Luc Rousseau, Sep 17 2018
If the analog of absolute difference, as described in the first comment, is determined by factorization into distinct terms of A050376 instead of by prime factorization, the equivalent operation is defined by A059897 and is associative. The positive integers form a group under A059897. The two factorization methods give the same factorization for squarefree numbers (A005117), so that T(.,.) restricted to A005117 is associative. Thus the squarefree numbers likewise form a group under the operation defined by this sequence. - Peter Munn, Apr 04 2019

Examples

			T(6,10) = lcm(6,10)/gcd(6,10) = 30/2 = 15.
  1,  2,  3,  4,  5, ...
  2,  1,  6,  2, 10, ...
  3,  6,  1, 12, 15, ...
  4,  2, 12,  1, 20, ...
  5, 10, 15, 20,  1, ...
  ...
		

Crossrefs

Programs

  • GAP
    T:=Flat(List([1..13],n->List([1..n-1],k->Lcm(k,n-k)/Gcd(k,n-k)))); # Muniru A Asiru, Oct 24 2018
    
  • Mathematica
    Flatten[Table[LCM[i, m - i]/GCD[i, m - i], {m, 15}, {i, m - 1}]] (* Ivan Neretin, Apr 27 2015 *)
  • PARI
    A089913(n,k)=n*k/gcd(n,k)^2 \\ M. F. Hasler, Dec 06 2019

Formula

A130836(n, k) = A001222(T(n, k)). - Luc Rousseau, Sep 17 2018

A157454 Triangle read by rows: T(n, m) = min(2*m - 1, 2*(n - m) + 1).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1, 3, 5, 3, 1, 1, 3, 5, 5, 3, 1, 1, 3, 5, 7, 5, 3, 1, 1, 3, 5, 7, 7, 5, 3, 1, 1, 3, 5, 7, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 9, 7, 5, 3, 1, 1, 3, 5, 7, 9, 11, 9, 7, 5, 3, 1
Offset: 1

Views

Author

Roger L. Bagula, Mar 01 2009

Keywords

Examples

			Triangle starts:
  1;
  1,  1;
  1,  3,  1;
  1,  3,  3,  1;
  1,  3,  5,  3,  1;
  1,  3,  5,  5,  3,  1;
  1,  3,  5,  7,  5,  3,  1;
  1,  3,  5,  7,  7,  5,  3,  1;
  1,  3,  5,  7,  9,  7,  5,  3,  1;
  1,  3,  5,  7,  9,  9,  7,  5,  3,  1;
  1,  3,  5,  7,  9, 11,  9,  7,  5,  3,  1;
  ...
		

Crossrefs

Row sums are A000982(n).

Programs

  • GAP
    Flat(List([1..12], n-> List([1..n], k-> Minimum(2*k-1, 2*(n-k)+1) ))); # G. C. Greubel, Jun 30 2019
    
  • Haskell
    import Data.List (inits)
    a157454 n k = a157454_tabl !! (n-1) !! (k-1)
    a157454_row n = a157454_tabl !! (n-1)
    a157454_tabl = concatMap h $ tail $ inits [1, 3 ..] where
       h xs = [xs ++ tail xs', xs ++ xs'] where xs' = reverse xs
    -- Reinhard Zumkeller, Dec 15 2013
    
  • Magma
    [[Min(2*k-1, 2*(n-k)+1): k in [1..n]]: n in [1..12]]; // G. C. Greubel, Jun 30 2019
    
  • Mathematica
    Table[Min[2*k-1, 2*(n-k)+1], {n,1,12}, {k,1,n}]//Flatten (* modified by G. C. Greubel, Jun 30 2019 *)
  • PARI
    {T(n,k) = min(2*k-1, 2*(n-k)+1)};
    for(n=1,12, for(k=1,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jun 30 2019
    
  • Python
    from math import isqrt
    def A157454(n): return (isqrt(n<<3)+1>>1)-abs((k:=n<<1)-((m:=isqrt(k))+(k>m*(m+1)))**2-1) # Chai Wah Wu, Jun 08 2025
  • Sage
    [[min(2*k-1, 2*(n-k)+1) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jun 30 2019
    

Formula

T(n,m) = T(n,n-m) = 2*m-1 for 0 <= m <= n/2, otherwise 2*(n-m)+1.
a(n) = 2*A003983(n) - 1.
From Ridouane Oudra, Jul 20 2019: (Start)
a(n) = A002024(n) - A049581(n-1).
a(n) = t - abs(t^2-2n+1), where t = floor(sqrt(2n)+1/2). (End)

Extensions

Edited by the Associate Editors of the OEIS, Apr 10 2009
Showing 1-10 of 23 results. Next