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 11-14 of 14 results.

A340804 Triangle read by rows: T(n, k) = 1 + k*(n - 1) + (2*k - n - 1)*(k mod 2) with 0 < k <= n.

Original entry on oeis.org

1, 1, 3, 1, 5, 9, 1, 7, 11, 13, 1, 9, 13, 17, 25, 1, 11, 15, 21, 29, 31, 1, 13, 17, 25, 33, 37, 49, 1, 15, 19, 29, 37, 43, 55, 57, 1, 17, 21, 33, 41, 49, 61, 65, 81, 1, 19, 23, 37, 45, 55, 67, 73, 89, 91, 1, 21, 25, 41, 49, 61, 73, 81, 97, 101, 121, 1, 23, 27, 45, 53, 67, 79, 89, 105, 111, 131, 133
Offset: 1

Views

Author

Stefano Spezia, Jan 22 2021

Keywords

Comments

T(n, k) is the k-th diagonal element of an 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.
It includes exclusively all the odd numbers (A005408). Except the term 1, all the other odd numbers appear a finite number of times.

Examples

			1
1,  3
1,  5,  9,
1,  7, 11, 13
1,  9, 13, 17, 25
1, 11, 15, 21, 29, 31
1, 13, 17, 25, 33, 37, 49
...
		

Crossrefs

Cf. A005408, A317614 (row sums).
Cf. A000012 (1st column), A006010 (sum of the first n rows), A060747 (2nd column), A074147 (antidiagonals of M matrices), A241016 (row sums of M matrices), A317617 (column sums of M matrices), A322277 (permanent of M matrices), A323723 (subdiagonal sum of M matrices), A323724 (superdiagonal sum of M matrices).

Programs

  • Mathematica
    Table[1+k(n-1)+(2k-n-1)Mod[k,2],{n,12},{k,n}]//Flatten
  • PARI
    T(n, k) = 1 + k*(n - 1) + (2*k - n - 1)*(k % 2); \\ Michel Marcus, Jan 25 2021

Formula

O.g.f.: (1 + y - 3*y^2 + y^3 + x*(-1 - y + 5*y^2 + y^3))/((-1 + x)^2*(-1 + y)^2*(1+y)^2).
E.g.f.: exp(x - y)*(1 + x + 2*y + exp(2*y)*(1 + x*(-1 + 2*y)))/2.

A322844 a(n) = (1/12)*n^2*(3*(1 + n^2) - 2*(2 + n^2)*(n mod 2)).

Original entry on oeis.org

0, 0, 5, 6, 68, 50, 333, 196, 1040, 540, 2525, 1210, 5220, 2366, 9653, 4200, 16448, 6936, 26325, 10830, 40100, 16170, 58685, 23276, 83088, 32500, 114413, 44226, 153860, 58870, 202725, 76880, 262400, 98736, 334373, 124950, 420228, 156066, 521645, 192660, 640400, 235340
Offset: 0

Views

Author

Stefano Spezia, Dec 28 2018

Keywords

Comments

Conjectures: (Start)
For n > 1, a(n) is the absolute value of the trace of the 2nd exterior power of an n X n square matrix M(n) defined as M[i,j,n] = j + n*(i-1) if i is odd and M[i,j,n] = n*i - j + 1 if i is even (see A317614). Equivalently, a(n) is the absolute value of the coefficient of the term [x^(n-2)] in the characteristic polynomial of the matrix M(n), or the absolute value of the sum of all principal minors of M(n) of size 2.
For k > 2, the trace of the k-th exterior power of the matrix M(n) is equal to zero.
(End)

Crossrefs

Cf. A317614 (trace of matrix M(n)).
Cf. A002415, A037270, A074147 (antidiagonals of M matrices), A241016 (row sums of M matrices), A317617 (column sums of M matrices), A322277 (permanent of matrix M(n)), A323723 (subdiagonal sum of M matrices), A323724 (superdiagonal sum of M matrices), A325516 (k-superdiagonal sum of M matrices), A325655 (k-subdiagonal sum of M matrices).

Programs

  • GAP
    Flat(List([0..50], n->(1/12)*n^2*(3*(1 + n^2) - 2*(2 + n^2)*(n mod 2))));
    
  • Magma
    [IsEven(n) select (1/4)*n^2*(1 + n^2) else (1/12)*(- 1 + n)*n^2*(1 + n): n in [0..50]];
    
  • Maple
    a:=n->(1/12)*n^2*(3*(1 + n^2) - 2*(2 + n^2)*modp(n,2)): seq(a(n), n=0..50);
  • Mathematica
    a[n_]:=(1/12)*n^2*(3*(1 + n^2) - 2*(2 + n^2)*Mod[n,2]); Array[a,50,0]
    LinearRecurrence[{0,5,0,-10,0,10,0,-5,0,1},{0,0,5,6,68,50,333,196,1040,540},50] (* Harvey P. Dale, Aug 23 2025 *)
  • Maxima
    a(n):=(1/12)*n^2*(3*(1 + n^2) - 2*(2 + n^2)*mod(n,2))$ makelist(a(n), n, 0, 50);
    
  • PARI
    a(n) = (1/12)*n^2*(3*(1 + n^2) - 2*(2 + n^2)*(n % 2));
    
  • PARI
    a(n) = abs(polcoeff(charpoly(matrix(n, n, i, j, if (i %2, j + n*(i-1), n*i - j + 1))), n-2)); \\ Michel Marcus, Feb 06 2019
    
  • Python
    [int(n**2*(3*(1 + n**2) - 2*(2 + n**2)*pow(n, 1, 2))/12) for n in range(0,50)]

Formula

O.g.f.: -x^2*(5 + 6*x + 43*x^2 + 20*x^3 + 43*x^4 + 6*x^5 + 5*x^6)/((-1 + x)^5*(1 + x)^5).
E.g.f.: (1/(12*x^2))*exp(-x)*(24 - 60*exp(x) + 21*x + 9*x^2 + 2*x^3 + x^4 + exp(2*x)*(36 - 33*x + 15*x^2 - 4*x^3 + 2*x^4)).
a(n) = (1/4)*n^2*(1 + n^2) for n even.
a(n) = (1/2)*A037270(n) for n even.
a(n) = (1/12)*(-1 + n)*n^2*(1 + n) for n odd.
a(n) = A002415(n) for n odd.
a(2*n+1) = 5*a(2*n-1) - 10*a(2*n-3) + 10*a(2*n-5) - 5*a(2*n-7) + a(2*n-9), for n > 4.
a(2*n) = 5*a(2*n-2) - 10*a(2*n-4) + 10*a(2*n-6) - 5*a(2*n-8) + a(2*n-10), for n > 4.
O.g.f. for a(2*n+1): -x*(2*(3 + 10*x + 3*x^2))/(-1 + x)^5.
O.g.f. for a(2*n): x*(-5 - 43*x - 43*x^2 - 5*x^3)/(-1 + x)^5.
E.g.f. for a(2*n+1): (1/12)*(6*x*cosh(sqrt(x)) + sqrt(x)*(6 + x)*sinh(sqrt(x))).
E.g.f. for a(2*n): (1/4)*(x*(8 + x)*cosh(sqrt(x)) + 2*sqrt(x)*(1 + 3*x)*sinh(sqrt(x))).
Sum_{k>=1} 1/a(2*k) = (1/6)*(12 + Pi^2 - 6*Pi*coth(Pi/2)) = 0.21955691692893092525407699347398665248691900...
Sum_{k>=1} 1/a(2*k+1) = 3*(5 - Pi^2/2) = 0.1955933983659620717482635001857732970...
Sum_{k>=2} 1/a(k) = 17 - (4*Pi^2)/3 - Pi*coth(Pi/2) = 0.415150315294892997002340493659759949516369894...

A109857 Next 2*n - 1 odd numbers in decreasing order followed by next 2*n even numbers in decreasing order.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Jul 08 2005

Keywords

Comments

This sequence is a permutation of the positive integers. - Werner Schulte, Jul 29 2023

Examples

			 1;
 4,  2;
 7,  5,  3;
12, 10,  8,  6;
17, 15, 13, 11,  9;
24, 22, 20, 18, 16, 14;
31, 29, 27, 25, 23, 21, 19;
40, 38, 36, 34, 32, 30, 28, 26;
		

Crossrefs

Cf. A074147 (row reversed), A074149 (row sums), A074148 (column 1), A001844, A061925 (main diagonal).

Programs

  • PARI
    T(n,k)=n*(n+1)/2+floor(n/2)-2*(k-1) \\ Werner Schulte, Jul 29 2023

Formula

From Werner Schulte, Jul 29 2023: (Start)
T(n, k) = n*(n+1)/2 + floor(n/2) - 2*(k-1) for 1 <= k <= n.
T(n, n) = (n^2-3*n+4)/2 + floor(n/2) for n > 0.
T(2*n-1, n) = n^2 + (n-1)^2 = A001844(n-1) for n > 0. (End)

Extensions

More terms from Joshua Zucker, May 05 2006

A376468 Triangle T read by rows: T(n, k) = (n^2 - 2*n + 3 - (-1)^n + n^2 mod 8) / 2 + 4*k.

Original entry on oeis.org

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

Views

Author

Werner Schulte, Sep 23 2024

Keywords

Comments

This triangle seen as a sequence yields a permutation of the natural numbers. For similar triangles see A000027 (seen as a triangle), A074147, and A367844 (row reversed).

Examples

			Triangle T(n, k) for 0 <= k <= n starts:
n \k :   0   1   2   3   4   5   6   7   8   9  10  11
======================================================
   0 :   1
   1 :   2   6
   2 :   3   7  11
   3 :   4   8  12  16
   4 :   5   9  13  17  21
   5 :  10  14  18  22  26  30
   6 :  15  19  23  27  31  35  39
   7 :  20  24  28  32  36  40  44  48
   8 :  25  29  33  37  41  45  49  53  57
   9 :  34  38  42  46  50  54  58  62  66  70
  10 :  43  47  51  55  59  63  67  71  75  79  83
  11 :  52  56  60  64  68  72  76  80  84  88  92  96
  etc.
		

Crossrefs

Programs

  • Mathematica
    Table[Range[#, #+n*4, 4] & [(Mod[n^2, 8] + n*(n-2) - (-1)^n + 3)/2], {n, 0, 15}] (* Paolo Xausa, Nov 13 2024 *)
  • PARI
    T(n,k)=(n^2-2*n+3-(-1)^n+n^2%8)/2+4*k
    
  • Python
    from math import comb, isqrt
    def A376468(n): return ((a:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)))*(a-2)+3+(1 if a&1 else -1)+(a**2&7)>>1)+(n-comb(a+1,2)<<2) # Chai Wah Wu, Nov 12 2024

Formula

T(n, k) = T(n, k-1) + 4.
T(n+4, 0) = T(n, n) + 4 for n > 3.
T(2*n, n) = 2 * (n^2 + n + 1) - (-1)^n = A001844(n) + 1 - (-1)^n.
Previous Showing 11-14 of 14 results.