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.

A323724 a(n) = n*(2*(n - 2)*n + (-1)^n + 3)/4.

Original entry on oeis.org

0, 0, 2, 6, 20, 40, 78, 126, 200, 288, 410, 550, 732, 936, 1190, 1470, 1808, 2176, 2610, 3078, 3620, 4200, 4862, 5566, 6360, 7200, 8138, 9126, 10220, 11368, 12630, 13950, 15392, 16896, 18530, 20230, 22068, 23976, 26030, 28158, 30440, 32800, 35322, 37926, 40700
Offset: 0

Views

Author

Stefano Spezia, Jan 25 2019

Keywords

Comments

For n > 1, a(n) is the superdiagonal sum of the matrix M(n) whose permanent is A322277(n).
All the terms of this sequence are even numbers (A005843), but do not end with 4.

Crossrefs

Programs

  • GAP
    Flat(List([0..50], n->(1/2)*(-1 + n)^2*n - (-1 + n)*Int(n/2) + 2*(Int(n/2))^2));
    
  • Magma
    [(1/2)*(-1 + n)^2*n - (-1 + n)*Floor(n/2) + 2*(Floor(n/2))^2: n in [0..50]];
    
  • Maple
    a:=n->(1/2)*(-1 + n)^2*n - (-1 + n)*floor(n/2) + 2*(floor(n/2))^2: seq(a(n), n=0..50);
  • Mathematica
    a[n_] := 1/2 (-1 + n)^2 n - (-1 + n) Floor[n/2] + 2 Floor[n/2]^2; Array[a, 50, 0];
    Table[n (2 (n - 2) n + (-1)^n + 3)/4, {n, 0, 50}] (* Bruno Berselli, Feb 06 2019 *)
    LinearRecurrence[{2,1,-4,1,2,-1},{0,0,2,6,20,40},50] (* Harvey P. Dale, Jan 13 2024 *)
  • Maxima
    makelist((1/2)*(-1 + n)^2*n - (-1 + n)*floor(n/2) + 2*(floor(n/2))^2, n, 0, 50);
    
  • PARI
    a(n) = (1/2)*(-1 + n)^2*n - (-1 + n)*floor(n/2) + 2*(floor(n/2))^2;
    
  • PARI
    T(i,j,n) = if (i %2, j + n*(i-1), n*i - j + 1);
    a(n) = sum(k=1, n-1, T(k,k+1,n)); \\ Michel Marcus, Feb 06 2019
    
  • Python
    [int((1/2)*(-1 + n)**2*n - (-1 + n)*int(n/2) + 2*(int(n/2))**2) for n in range(0,50)]

Formula

O.g.f.: 2*x^2*(1 + x + 3*x^2 + x^3)/((1 - x)^4*(1 + x)^2).
E.g.f.: (1/2)*x*(exp(x)*x*(1 + x) + sinh(x)).
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n > 5.
a(n) = (1/2)*(-1 + n)^2*n - (-1 + n)*floor(n/2) + 2*floor(n/2)^2.
a(n) = (1/2)*(-1 + n)^2*n - (-1 + n)*A004526(n) + 2*A000290(A004526(n)).
a(n) = (n/2)*((n - 1)^2 + 1) for even n; a(n) = (n/2)*(n - 1)^2 otherwise. - Bruno Berselli, Feb 06 2019
a(n) = 2*A004526(n*A000982(n-1)). [Found by Christian Krause's LODA miner] - Stefano Spezia, Dec 12 2021
a(n) = 2*A005997(n-1) for n >= 2. - Hugo Pfoertner, Dec 13 2021

Extensions

Definition by Bruno Berselli, Feb 06 2019