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 51-60 of 90 results. Next

A353452 a(n) is the determinant of the n X n symmetric matrix M(n) that is defined as M[i,j] = abs(i - j) if min(i, j) < max(i, j) <= 2*min(i, j), and otherwise 0.

Original entry on oeis.org

1, 0, -1, 0, 1, -4, 12, 64, -172, -1348, 3456, 34240, -87084, 370640, -872336, -22639616, 52307088, -181323568, 399580288, 23627011200, -51305628400, -686160247552, 1545932859328, 68098264912128, -155370174372864, 6326621032802304, -13829529077133312, -1087288396552040448
Offset: 0

Views

Author

Stefano Spezia, Apr 19 2022

Keywords

Examples

			a(8) = -172:
    0,  1,  0,  0,  0,  0,  0,  0;
    1,  0,  1,  2,  0,  0,  0,  0;
    0,  1,  0,  1,  2,  3,  0,  0;
    0,  2,  1,  0,  1,  2,  3,  4;
    0,  0,  2,  1,  0,  1,  2,  3;
    0,  0,  3,  2,  1,  0,  1,  2;
    0,  0,  0,  3,  2,  1,  0,  1;
    0,  0,  0,  4,  3,  2,  1,  0.
		

Crossrefs

Cf. A000982 (number of zero matrix elements), A003983, A006918, A007590 (number of positive matrix elements), A049581, A051125, A173997, A350050, A352967, A353453 (permanent).

Programs

  • Mathematica
    Join[{1},Table[Det[Table[If[Min[i,j]
    				
  • PARI
    a(n) = matdet(matrix(n, n, i, j, if ((min(i,j) < max(i,j)) && (max(i,j) <= 2*min(i,j)), abs(i-j)))); \\ Michel Marcus, Apr 20 2022
    
  • Python
    from sympy import Matrix
    def A353452(n): return Matrix(n, n, lambda i, j: abs(i-j) if min(i,j)Chai Wah Wu, Aug 29 2023

Formula

Sum_{i=1..n+1-k} M[i,i+k] = A173997(n, k) with 1 <= k <= floor((n + 1)/2).
Sum_{i=1..n} Sum_{j=1..n} M[i,j] = 2*A006918(n-1).
Sum_{i=1..n} Sum_{j=1..n} M[i,j]^2 = A350050(n+1).

A353453 a(n) is the permanent of the n X n symmetric matrix M(n) that is defined as M[i,j] = abs(i - j) if min(i, j) < max(i, j) <= 2*min(i, j), and otherwise 0.

Original entry on oeis.org

1, 0, 1, 0, 1, 4, 64, 576, 7844, 63524, 882772, 11713408, 252996564, 5879980400, 184839020672, 5698866739200, 229815005974352, 9350598794677712, 480306381374466176, 23741710999960266176, 1446802666239931811472, 86153125248221968292928, 6197781268948296566634304
Offset: 0

Views

Author

Stefano Spezia, Apr 19 2022

Keywords

Examples

			a(8) = 7844:
    0,  1,  0,  0,  0,  0,  0,  0;
    1,  0,  1,  2,  0,  0,  0,  0;
    0,  1,  0,  1,  2,  3,  0,  0;
    0,  2,  1,  0,  1,  2,  3,  4;
    0,  0,  2,  1,  0,  1,  2,  3;
    0,  0,  3,  2,  1,  0,  1,  2;
    0,  0,  0,  3,  2,  1,  0,  1;
    0,  0,  0,  4,  3,  2,  1,  0.
		

Crossrefs

Cf. A000982 (number of zero matrix elements), A003983, A006918, A007590 (number of positive matrix elements), A049581, A051125, A173997, A350050, A352967, A353452 (determinant).

Programs

  • Mathematica
    Join[{1},Table[Permanent[Table[If[Min[i,j]
    				
  • PARI
    a(n) = matpermanent(matrix(n, n, i, j, if ((min(i,j) < max(i,j)) && (max(i,j) <= 2*min(i,j)), abs(i-j)))); \\ Michel Marcus, Apr 20 2022
    
  • Python
    from sympy import Matrix
    def A353453(n): return Matrix(n, n, lambda i, j: abs(i-j) if min(i,j)Chai Wah Wu, Aug 29 2023

Formula

Sum_{i=1..n+1-k} M[i,i+k] = A173997(n, k) with 1 <= k <= floor((n + 1)/2).
Sum_{i=1..n} Sum_{j=1..n} M[i,j] = 2*A006918(n-1).
Sum_{i=1..n} Sum_{j=1..n} M[i,j]^2 = A350050(n+1).

A062870 Number of permutations of degree n with greatest sum of distances.

Original entry on oeis.org

1, 1, 1, 3, 4, 20, 36, 252, 576, 5184, 14400, 158400, 518400, 6739200, 25401600, 381024000, 1625702400, 27636940800, 131681894400, 2501955993600, 13168189440000, 276531978240000, 1593350922240000, 36647071211520000, 229442532802560000, 5736063320064000000
Offset: 0

Views

Author

Olivier Gérard, Jun 26 2001

Keywords

Comments

Number of possible values is 1,2,3,5,7,10,13,17,21,... which I conjecture to be A033638. Maximum distance divided by 2 is the same minus one, i.e., 0,1,2,4,6,9,12,16,20,... which seems to be A002620.

Examples

			(4,3,1,2) has distances (3,1,2,2), sum is 8 and there are 3 other permutations of degree 4 {3, 4, 1, 2}, {3, 4, 2, 1}, {4, 3, 2, 1} with this sum which is the maximum possible.
		

Crossrefs

A007590(n) is the greatest sum of distances for a permutation of degree n. - Dmitry Kamenetsky, Nov 14 2017

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, 1+n*(n-1),
          (n*((n-1)^2*(3*n-4)*a(n-2)-4*a(n-1)))/(4*(n-1)*(3*n-7)))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Jan 16 2014
  • Mathematica
    a[n_?EvenQ] := (n/2)!^2; a[n_?OddQ] := n*((n-1)/2)!^2; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Apr 15 2015 *)
  • PARI
    for(k=0,20,print1((2*k+1)*k!^2","(k+1)!^2",")) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 27 2007

Formula

a(n) = (n/2)!^2 if n is even else n*((n-1)/2)!^2, cf. A092186. - Conjectured by Vladeta Jovovic, Aug 21 2007; proved (see the link) by Max Alekseyev, Aug 21 2007
a(n) = A062869(n,floor(n^2/4)) for n>=1. - Alois P. Heinz, Oct 02 2022

Extensions

a(10)-a(14) from Hugo Pfoertner, Sep 23 2004
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 27 2007

A123956 Triangle of coefficients of polynomials P(k) = 2*X*P(k - 1) - P(k - 2), P(0) = -1, P(1) = 1 + X, with twisted signs.

Original entry on oeis.org

-1, 1, 1, -1, -2, -2, 1, -3, 4, 4, -1, 4, 8, -8, -8, 1, 5, -12, -20, 16, 16, -1, -6, -18, 32, 48, -32, -32, 1, -7, 24, 56, -80, -112, 64, 64, -1, 8, 32, -80, -160, 192, 256, -128, -128, 1, 9, -40, -120, 240, 432, -448, -576, 256, 256, -1, -10, -50, 160, 400, -672, -1120, 1024, 1280, -512, -512
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Oct 27 2006

Keywords

Comments

Up to signs also the coefficients of polynomials y(n+1) = y(n-1) - 2*h*y(n), arising when the ODE y' = -y is numerically solved with the leapfrog (a.k.a. two-step Nyström) method, with y(0) = 1, y(1) = 1 - h. In this case, the coefficients are negative exactly for the odd powers of h. - M. F. Hasler, Nov 30 2022

Examples

			Triangle begins:
  {-1},
  { 1,   1},
  {-1,  -2,  -2},
  { 1,  -3,   4,    4},
  {-1,   4,   8,   -8,   -8},
  { 1,   5, -12,  -20,   16,   16},
  {-1,  -6, -18,   32,   48,  -32,   -32},
  { 1,  -7,  24,   56,  -80, -112,    64,   64},
  {-1,   8,  32,  -80, -160,  192,   256, -128, -128},
  { 1,   9, -40, -120,  240,  432,  -448, -576,  256,  256},
  {-1, -10, -50,  160,  400, -672, -1120, 1024, 1280, -512, -512},
  ...
		

References

  • CRC Standard Mathematical Tables and Formulae, 16th ed. 1996, p. 484.
  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 799.

Crossrefs

Programs

  • Mathematica
    p[ -1, x] = 0; p[0, x] = 1; p[1, x] = x + 1;
    p[k_, x_] := p[k, x] = 2*x*p[k - 1, x] - p[k - 2, x];
    w = Table[CoefficientList[p[n, x], x], {n, 0, 10}];
    An[d_] := Table[If[n == d && m  1/y)] /. 1/y -> 1, y], {d, 1, 11}] // Flatten
  • PARI
    P=List([-1,1-'x]); {A123956(n,k)=for(i=#P, n+1, listput(P, P[i-1]-2*'x*P[i])); polcoef(P[n+1],k)*(-1)^((n-k-1)\2+!k*n\2)} \\ M. F. Hasler, Nov 30 2022

Formula

From M. F. Hasler, Nov 30 2022: (Start)
a(n,0) = (-1)^(n+1), a(n,1) = (-1)^floor(n/2)*n,
a(n,2) = (-1)^floor((n+1)/2)*A007590(n) = (-1)^floor((n+1)/2)*floor(n^2 / 2),
a(n,n) = a(n,n-1) = (-2)^(n-1) (n > 0),
a(n,3) / a(n,2) = { n/3 if n odd, -4*(n+2)/n if n even },
a(n,4) / a(n,3) = n/4 if n is even. (End)
From Peter Bala, Feb 06 2025: (Start)
Let T(n, x) and U(n, x) denote the n-th Chebyshev polynomial of the first and second kind. It appears that the row g.f.'s are as follows: for n >= 0,
row 4*n+1: T(4*n+1, x) + U(4*n, x); row 4*n+2: - 2 - T(4*n+2, x) - U(4*n+1, x);
row 4*n+3: 2 + T(4*n+3, x) + U(4*n+2, x); row 4*n+4: - T(4*n+4, x) - U(4*n+3, x). (End)

Extensions

Offset changed to 0 by M. F. Hasler, Nov 30 2022

A131476 a(n) = floor(n^3/3).

Original entry on oeis.org

0, 0, 2, 9, 21, 41, 72, 114, 170, 243, 333, 443, 576, 732, 914, 1125, 1365, 1637, 1944, 2286, 2666, 3087, 3549, 4055, 4608, 5208, 5858, 6561, 7317, 8129, 9000, 9930, 10922, 11979, 13101, 14291, 15552, 16884, 18290, 19773, 21333, 22973
Offset: 0

Views

Author

Mohammad K. Azarian, Jul 27 2007

Keywords

Crossrefs

Programs

Formula

From R. J. Mathar, Dec 19 2008: (Start)
G.f.: x^2*(2 + 3*x + x^3)/((1 - x)^4*(1 + x + x^2)).
a(n) = (A057078(n) - A024001(n))/3. (End)
a(n) = (3*n^3 + 3*cos(2*Pi*n/3) + sqrt(3)*sin(2*Pi*n/3) - 3)/9. - Vladimir Reshetnikov, Oct 09 2016
a(n) = (n - 1)*n*(n + 1)/3 + floor(n/3). - Bruno Berselli, Jun 08 2017

A131479 a(n) = floor(n^4/4).

Original entry on oeis.org

0, 0, 4, 20, 64, 156, 324, 600, 1024, 1640, 2500, 3660, 5184, 7140, 9604, 12656, 16384, 20880, 26244, 32580, 40000, 48620, 58564, 69960, 82944, 97656, 114244, 132860, 153664, 176820, 202500, 230880, 262144, 296480, 334084, 375156
Offset: 0

Views

Author

Mohammad K. Azarian, Jul 27 2007

Keywords

Crossrefs

Programs

Formula

From R. J. Mathar, Dec 19 2008: (Start)
G.f.: 4*x^2*(1+x+x^2)/((1+x)*(1-x)^5).
a(n) = 4*A011863(n-1). (End)
a(n) = floor(n^2/2)*ceiling(n^2/2) = A007590(n) * A000982(n). - Enrique Pérez Herrero, May 31 2015
Sum_{n>=2} 1/a(n) = Sum_{n>=1} 1/(4n^4) + Sum_{n>=1} 1/(2n*(n+1)*(2n^2+2n+1)) = Zeta(4)/4 + (3-Pi*tanh(Pi/2))/2. - Enrique Pérez Herrero, May 31 2015
a(2*k) = 4*k^4; a(2*k+1) = 2*(k^3*(k+1) + k*(k+1)^3). - Robert Israel, Jun 01 2015
E.g.f.: (x*(x^3 + 6*x^2 + 7*x + 1)*cosh(x) + (x^4 + 6*x^3 + 7*x^2 + x - 1)*sinh(x))/4. - Stefano Spezia, Feb 18 2023

A215098 a(0)=0, a(1)=1, a(n) = n*(n-1) - a(n-2).

Original entry on oeis.org

0, 1, 2, 5, 10, 15, 20, 27, 36, 45, 54, 65, 78, 91, 104, 119, 136, 153, 170, 189, 210, 231, 252, 275, 300, 325, 350, 377, 406, 435, 464, 495, 528, 561, 594, 629, 666, 703, 740, 779, 820, 861, 902, 945, 990, 1035, 1080, 1127, 1176, 1225, 1274, 1325, 1378, 1431
Offset: 0

Views

Author

Alex Ratushnyak, Aug 03 2012

Keywords

Comments

Same seed, b(n) = n*(n+1) - b(n-2) : 0, 1, 6, 11, 14, 19, 28, 37, 44, 53, 66, 79, 90, 103, 120, 137, 152, 169, 190, 211, 230, 251, 276, 301, 324, 349, 378, 407, 434, 463, 496, 529, 560, 593, ...
b(n) = a(n+1) - 1 if (n mod 4) < 2, otherwise b(n) = a(n+1) + 1.

Crossrefs

Cf. A007590 (a(0)=0, a(n) = n*(n-1) - a(n-1)).
Cf. A178218 (a(1)=1, a(n) = n*(n+1) - a(n-1)).

Programs

  • Magma
    [n le 2 select n-1 else  2*Binomial(n-1,2) -Self(n-2): n in [1..81]]; // G. C. Greubel, Nov 25 2022
    
  • Mathematica
    CoefficientList[Series[(x -x^2 +3x^3 -x^4)/(1 -3x +4x^2 -4x^3 +3x^4 -x^5), {x, 0, 70}], x] (* Vincenzo Librandi, Jul 18 2013 *)
    RecurrenceTable[{a[0]==0,a[1]==1,a[n]==n(n-1)-a[n-2]},a,{n,60}] (* or *) LinearRecurrence[{3,-4,4,-3,1},{0,1,2,5,10},60] (* Harvey P. Dale, May 15 2016 *)
  • Python
    prpr = 0
    prev = 1
    for n in range(2,77):
        print(prpr, end=', ')
        curr = n*(n-1) - prpr
        prpr = prev
        prev = curr
    
  • SageMath
    def A215098(n):
        if (n<2): return n
        else: return 2*binomial(n,2) - A215098(n-2)
    [A215098(n) for n in range(81)] # G. C. Greubel, Nov 25 2022

Formula

G.f.: x*(1-x+3*x^2-x^3)/(1-3*x+4*x^2-4*x^3+3*x^4-x^5). - David Scambler, Aug 06 2012
a(n) = (n^2 +n -1 +cos(pi*n/2) +sin(pi*n/2))/2. - Vaclav Kotesovec, Aug 11 2012

A241685 The total number of squares and rectangles appearing in the Thue-Morse sequence logical matrices after n stages.

Original entry on oeis.org

0, 2, 4, 18, 60, 242, 924, 3698, 14620, 58482, 233244, 932978, 3729180, 14916722, 59655964, 238623858, 954451740, 3817806962, 15271053084, 61084212338, 244336150300, 977344601202, 3909375608604
Offset: 0

Views

Author

Kival Ngaokrajang, Apr 27 2014

Keywords

Comments

a(n) is the total number of unit squares (A241682), 2 X 2 squares (A241683), 2 X 1 and 1 X 2 rectangles (A241684) that appear in the Thue-Morse logical matrices after n stages. See links for more details.

Crossrefs

Cf. A010060.

Programs

  • Mathematica
    Table[Floor[(2^(n + 2) + 3 - (-1)^n)^2/72], {n, 0, 50}] (* G. C. Greubel, Sep 29 2017 *)
  • PARI
    {for (n=1,50, b=(2^(n+1)+3+(-1)^n)/6; a=floor(b^2/2); print1(a,","))}

Formula

a(n) = A007590(A005578(n+1)).
Empirical g.f.: -2*x*(4*x^3-4*x^2-2*x+1) / ((x-1)*(x+1)*(2*x-1)*(2*x+1)*(4*x-1)). - Colin Barker, Apr 27 2014
a(n) = floor((2^(n + 2) + 3 - (-1)^n)^2/72). - G. C. Greubel, Sep 29 2017

A248345 Signed version of A094953.

Original entry on oeis.org

1, -1, 2, 2, -4, 3, -2, 8, -9, 4, 3, -12, 21, -16, 5, -3, 18, -39, 44, -25, 6, 4, -24, 66, -96, 80, -36, 7, -4, 32, -102, 184, -200, 132, -49, 8, 5, -40, 150, -320, 430, -372, 203, -64, 9, -5, 50, -210, 520, -830, 888, -637, 296, -81, 10, 6, -60, 285, -800, 1480, -1884, 1673, -1024, 414, -100, 11
Offset: 0

Views

Author

Derek Orr, Oct 30 2014

Keywords

Comments

This is the transformation of the polynomial 1 + 2x + 3x^2 + 4x^3 + ... + n*x^(n-1)+(n+1)*x^n to the polynomial A_0*(x+1)^0 + A_1*(x+1)^1 + A_2*(x+1)^2 + ... + A_n*(x+1)^n. This sequence gives A_0, ... A_n as the entries in the n-th row of this triangle, starting at n = 0.

Examples

			1;
-1,  2;
2,  -4,    3;
-2,  8,   -9,    4;
3, -12,   21,  -16,    5;
-3, 18,  -39,   44,  -25,    6;
4, -24,   66,  -96,   80,  -36,    7;
-4, 32, -102,  184, -200,  132,  -49,   8;
5, -40,  150, -320,  430, -372,  203, -64,   9;
-5, 50, -210,  520, -830,  888, -637, 296, -81, 10
		

Crossrefs

Programs

  • PARI
    T(n,k)=(k+1)*sum(i=0,n-k,(-1)^i*binomial(i+k+1,k+1))
    for(n=0,15,for(k=0,n,print1(T(n,k),", ")))

Formula

Rows sum to 1.
T(n,n) = n for n >= 0.
T(n,n-1) = -n^2 for n >= 1.
T(n,2) = A007518(n)*(-1)^n for n >= 2.
T(n,1) = A007590(n+1)*(-1)^(n+1) for n >= 1.
T(n,0) = A001057(n+1) for n >= 0.

A274106 Triangle read by rows: T(n,k) = total number of configurations of k nonattacking bishops on the white squares of an n X n chessboard (0 <= k <= n-1+[n=0]).

Original entry on oeis.org

1, 1, 1, 2, 1, 4, 2, 1, 8, 14, 4, 1, 12, 38, 32, 4, 1, 18, 98, 184, 100, 8, 1, 24, 188, 576, 652, 208, 8, 1, 32, 356, 1704, 3532, 2816, 632, 16, 1, 40, 580, 3840, 12052, 16944, 9080, 1280, 16, 1, 50, 940, 8480, 38932, 89256, 93800, 37600, 3856, 32, 1, 60, 1390, 16000, 98292, 322848, 540080, 412800, 116656, 7744, 32
Offset: 0

Views

Author

N. J. A. Sloane, Jun 14 2016

Keywords

Comments

From Eder G. Santos, Dec 16 2024: (Start)
The sequence counts every possible nonattacking configuration of k bishops on the white squares of an n X n chess board.
It is assumed that the n X n chess board has a black square in the upper left corner.
(End)

Examples

			Triangle begins:
  1;
  1;
  1,  2;
  1,  4,    2;
  1,  8,   14,     4;
  1, 12,   38,    32,     4;
  1, 18,   98,   184,   100,      8;
  1, 24,  188,   576,   652,    208,      8;
  1, 32,  356,  1704,  3532,   2816,    632,     16;
  1, 40,  580,  3840, 12052,  16944,   9080,   1280,     16;
  1, 50,  940,  8480, 38932,  89256,  93800,  37600,   3856,   32;
  1, 60, 1390, 16000, 98292, 322848, 540080, 412800, 116656, 7744, 32;
  ...
From _Eder G. Santos_, Dec 16 2024: (Start)
For example, for n = 3, k = 2, the T(3,2) = 2 nonattacking configurations are:
  +---+---+---+   +---+---+---+
  |   | B |   |   |   |   |   |
  +---+---+---+   +---+---+---+
  |   |   |   | , | B |   | B |
  +---+---+---+   +---+---+---+
  |   | B |   |   |   |   |   |
  +---+---+---+   +---+---+---+
(End)
		

Crossrefs

Columns k=0-1 give: A000012, A007590.
Alternate rows give A088960.
Row sums are A216078(n+1).
T(2n,n) gives A191236.
T(2n+1,n) gives A217900(n+1).
T(n+1,n) gives A060546.
Cf. A274105 (black squares), A288182, A201862, A002465.

Programs

  • Maple
    with(combinat): with(gfun):
    T := n -> add(stirling2(n+1,n+1-k)*x^k, k=0..n):
    # bishops on white squares
    bish := proc(n) local m,k,i,j,t1,t2; global T;
        if n=0 then return [1] fi;
        if (n mod 2) = 0 then m:=n/2;
            t1:=add(binomial(m,k)*T(2*m-1-k)*x^k, k=0..m);
        else
            m:=(n-1)/2;
            t1:=add(binomial(m,k)*T(2*m-k)*x^k, k=0..m+1);
        fi;
        seriestolist(series(t1,x,2*n+1));
    end:
    for n from 0 to 12 do lprint(bish(n)); od:
  • Mathematica
    T[n_] := Sum[StirlingS2[n+1, n+1-k]*x^k, {k, 0, n}];
    bish[n_] := Module[{m, t1, t2}, If[Mod[n, 2] == 0,
       m = n/2;     t1 = Sum[Binomial[m, k]*T[2*m-1-k]*x^k, {k, 0, m}],
       m = (n-1)/2; t1 = Sum[Binomial[m, k]*T[2*m - k]*x^k, {k, 0, m+1}]];
    CoefficientList[t1 + O[x]^(2*n+1), x]];
    Table[bish[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Jul 25 2022, after Maple code *)
  • SageMath
    def stirling2_negativek(n, k):
      if k < 0: return 0
      else: return stirling_number2(n, k)
    print([sum([binomial(floor(n/2), j)*stirling2_negativek(n-j, n-k) for j in [0..k]]) for n in [0..10] for k in [0..n-1+kronecker_delta(n,0)]]) # Eder G. Santos, Dec 01 2024

Formula

From Eder G. Santos, Dec 01 2024: (Start)
T(n,k) = Sum_{j=0..k} binomial(floor(n/2),j) * Stirling2(n-j,n-k).
T(n,k) = T(n-1,k) + (n-k+1-A000035(n)) * T(n-1,k-1), T(n,0) = 1, T(0,k) = delta(k,0). (End)

Extensions

T(0,0) prepended by Eder G. Santos, Dec 01 2024
Previous Showing 51-60 of 90 results. Next