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 21-23 of 23 results.

A325657 a(n) = (1/2)*(-1 + (-1)^n)*(n-1) + n^2.

Original entry on oeis.org

0, 1, 4, 7, 16, 21, 36, 43, 64, 73, 100, 111, 144, 157, 196, 211, 256, 273, 324, 343, 400, 421, 484, 507, 576, 601, 676, 703, 784, 813, 900, 931, 1024, 1057, 1156, 1191, 1296, 1333, 1444, 1483, 1600, 1641, 1764, 1807, 1936, 1981, 2116, 2163, 2304, 2353, 2500, 2551
Offset: 0

Views

Author

Stefano Spezia, May 13 2019

Keywords

Comments

For n > 0, a(n) is the n-th element of the diagonal of the triangle A325655. Equivalently, a(n) is the element M_{n,1} of the matrix M(n) whose permanent is A322277(n).

Crossrefs

Programs

  • GAP
    Flat(List([0..55], n->(1/2)*(- 1 + (- 1)^n)*(n - 1) + n^2));
    
  • Magma
    [(1/2)*(- 1 + (- 1)^n)*(n - 1) + n^2: n in [0..55]];
    
  • Maple
    a:=n->(1/24)*n*(3 - 3*(- 1)^n + 4*n + 6*n^2 + 8*n^3): seq(a(n), n=0..55);
  • Mathematica
    Table[(1/2)*(- 1+(-1)^n)*(n-1)+n^2,{n,0,55}]
  • PARI
    a(n) = (1/2)*(- 1 + (- 1)^n)*(n - 1) + n^2;

Formula

O.g.f.: (-1 - 3*x - x^2 - 3*x^3)/((-1 + x)^3*(1+x)^2).
E.g.f.: (1/2)*exp(-x)*(-1 - x + exp(2*x)*(1 + x + 2*x^2)).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n > 4
a(n) = n^2 if n is even.
a(n) = n^2 - n + 1 if n is odd.

A350236 a(n) is the sum of the entries in an n X n X n 3D matrix whose elements start at 1 in the corner cells and increase by 1 with each step towards the center.

Original entry on oeis.org

1, 8, 54, 160, 425, 864, 1666, 2816, 4617, 7000, 10406, 14688, 20449, 27440, 36450, 47104, 60401, 75816, 94582, 116000, 141561, 170368, 204194, 241920, 285625, 333944, 389286, 450016, 518897, 594000, 678466, 770048, 872289, 982600, 1104950, 1236384, 1381321
Offset: 1

Views

Author

Saeed Barari, Dec 21 2021

Keywords

Comments

The 2D version of this problem is discussed in A317614.

Examples

			For n=3: we have the following 3D matrix: (sliced for each Z surface)
(z=1): 1 2 1
       2 3 2
       1 2 1
(z=2): 2 3 2
       3 4 3
       2 3 2
(z=3): 1 2 1
       2 3 2
       1 2 1
The sum of all elements is: (3/4)*n^2 * (n^2 - 2/3*n + (n mod 2)) = 54.
		

Crossrefs

Cf. A317614.

Programs

  • Maple
    a:=n->(3/4)*n^2 * (n^2 - (2/3)*n + modp(n, 2)): seq(a(n), n=1..50);
  • Mathematica
    LinearRecurrence[{2,2,-6,0,6,-2,-2,1},{1,8,54,160,425,864,1666,2816},35] (* Stefano Spezia, May 19 2022 *)
  • Python
    for n in range(1, nmax):
      sum = round(3/4*n**2 * (n**2 - 2/3*n + n % 2))
      print(sum, end=', ')

Formula

a(n) = (3/4)*n^2 * (n^2 - 2/3*n + (n mod 2)).
From Stefano Spezia, May 19 2022: (Start)
O.g.f.: x*(1 + 6*x + 36*x^2 + 42*x^3 + 45*x^4 + 12*x^5 + 2*x^6)/((1 - x)^5*(1 + x)^3).
E.g.f.: x*((4 + 15*x + 16*x^2 + 3*x^3)*cosh(x) + (1 + 18*x + 16*x^2 + 3*x^3)*sinh(x))/4.
a(n) = 2*a(n-1) + 2*a(n-2) - 6*a(n-3) + 6*a(n-5)- 2*a(n-6) - 2*a(n-7) + a(n-8) for n > 8. (End)

Extensions

Python program and a(23), a(34) corrected by Georg Fischer, Sep 30 2022

A382597 a(n) = Product_{i=1..n} 1 - i + n*(n - i + 1) - (n - 2*i + 1)*((n - i + 1) mod 2).

Original entry on oeis.org

1, 1, 8, 105, 3840, 181545, 15814656, 1635491025, 261144576000, 47396578806225, 12046266925056000, 3390530144534798265, 1256223498048110592000, 506594307608708171477625, 257699484814807738928332800, 140934799049120316306629726625, 94240120920042785192632469422080
Offset: 0

Views

Author

Stefano Spezia, Mar 31 2025

Keywords

Comments

a(n) is the product of the elements of the main antidiagonal of the n X n square matrix M(n) formed by writing the numbers 1, ..., n^2 successively forward and backward along the rows in zig-zag pattern (see A317614).
Except for n = 0, 2, and 6, a(n) has trailing zeros iff n is even.

Examples

			a(4) = 3840:
   1,  2,  3,  4;
   8,  7,  6,  5;
   9, 10, 11, 12;
  16, 15, 14, 13.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Product[1-i+n(n-i+1)-(n-2i+1)Mod[n-i+1,2],{i,n}]; Array[a,17,0]
Previous Showing 21-23 of 23 results.