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 31-40 of 55 results. Next

A213197 T(n,k) = (2*(n+k)^2 - 2*(n+k) - 4*k + 6 + (2*k-2)*(-1)^n + (2*k-1)*(-1)^k + (-2*n+1)*(-1)^(n+k))/4; n, k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Mar 01 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Enumeration table T(n,k). Let m be natural number. The order of the list:
T(1,1)=1;
T(3,1), T(2,2), T(1,3);
T(2,1), T(1,2);
...
T(1,2*m+1), T(1,2*m), T(2, 2*m-1), T(3, 2*m-1),... T(2*m,1), T(2*m+1,1);
T(2*m,2), T(2*m-2,4), ...T(2,2*m);
...
Movement along two adjacent antidiagonals. The first row consists of phases: step to the west, step to the southwest, step to the south. The second row consists of phases: 2 steps to the north, 2 steps to the east. The length of each step is 1.

Examples

			The start of the sequence as a table:
   1,  3,  2,  8,  7, 17, 16, ...
   4,  6,  9, 15, 18, 28, 31, ...
   5, 11, 10, 20, 19, 33, 32, ...
  12, 14, 21, 27, 34, 44, 51, ...
  13, 23, 22, 36, 35, 53, 52, ...
  24, 26, 37, 43, 54, 64, 75, ...
  25, 39, 38, 56, 55, 77, 76, ...
  ...
The start of the sequence as a triangular array read by rows:
   1;
   3,  4;
   2,  6,  5;
   8,  9, 11, 12;
   7, 15, 10, 14, 13;
  17, 18, 20, 21, 23, 24;
  16, 28, 19, 27, 22, 26, 25;
  ...
The start of the sequence as an array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from row 2*r-2 of the triangular array above.
Last  2*r-1 numbers are from row 2*r-1 of the triangular array above.
   1;
   3,  4,  2,  6,  5;
   8,  9, 11, 12,  7, 15, 10, 14, 13;
  17, 18, 20, 21, 23, 24, 16, 28, 19, 27, 22, 26, 25;
  ...
Row r contains permutation of 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+5, 2*r*r-5*r+6, ..., 2*r*r-2*r+2, 2*r*r-2*r+1.
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->(2*(n+k)^2-2*(n+k)-4*k+6+(2*k-2)*(-1)^n+(2*k-1)*(-1)^k+(1-+2*n)*(-1)^(n+k))/4: seq(seq(T(k,n-k),k=1..n-1),n=1..13); # Muniru A Asiru, Dec 06 2018
  • Mathematica
    T[n_, k_] := (2(n+k)^2 - 2(n+k) - 4k + 6 + (2k-2)(-1)^n + (2k-1)(-1)^k + (-2n+1)(-1)^(n+k))/4;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 06 2018 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=(2*(t+2)**2-2*(t+2)-4*j+6 +(2*j-2)*(-1)**i+(2*j-1)*(-1)**j+(-2*i+1)*(-1)**t)/4

Formula

As a table:
T(n,k) = (2*(n+k)^2 - 2*(n+k) - 4*k + 6 + (2*k-2)*(-1)^n + (2*k-1)*(-1)^k + (-2*n+1)*(-1)^(n+k))/4.
As a linear sequence:
a(n) = (2*A003057(n)^2 - 2*A003057(n) - 4*A004736(n) + 6 + (2*A004736(n)-2)*(-1)^A002260(n) + (2*A004736(n)-1)*(-1)^A004736(n) + (-2*A002260(n)+1)*(-1)^A003056(n))/4;
a(n) = (2*(t+2)^2 - 2*(t+2) - 4*j + 6 + (2*j-2)*(-1)^i + (2*j-1)*(-1)^j + (-2*i+1)*(-1)^t)/4, where i = n - t*(t+1)/2, j = (t*t + 3*t + 4)/2 - n, t = floor((-1+sqrt(8*n-7))/2).

A213205 T(n,k) = ((k+n)^2-4*k+3+(-1)^k-2*(-1)^n-(k+n)*(-1)^(k+n))/2; n , k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 15 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Enumeration table T(n,k). The order of the list:
T(1,1)=1;
T(1,3), T(2,2), T(2,1), T(1,2), T(3,1);
. . .
T(1,2*n+1), T(2,2*n), T(2,2*n-1), T(1,2*n), ...T(2*n-1,3), T(2*n,2), T(2*n,1), T(2*n-1,2), T(2*n+1,1);
. . .
Movement along two adjacent antidiagonals - step to the southwest, step to the west, step to the northeast, 2 steps to the south, step to the west and so on. The length of each step is 1.
Table contains:
row 1 accommodates elements A130883 in odd places,
row 2 is alternation of elements A100037 and A033816;
column 1 is alternation of elements A000384 and A091823,
column 2 is alternation of elements A014106 and A071355,
column 3 accommodates elements A130861 in even places;
main diagonal is alternation of elements A188135 and A033567,
diagonal 1, located above the main diagonal accommodates elements A033566 in even places,
diagonal 2, located above the main diagonal is alternation of elements A139271 and A024847,
diagonal 3, located above the main diagonal accommodates of elements A033585.

Examples

			The start of the sequence as table:
1....5...2..10...7..19..16...
4....3...9...8..18..17..31...
6...14..11..23..20..36..33...
13..12..22..21..35..34..52...
15..27..24..40..37..57..54...
26..25..39..38..56..55..77...
28..44..41..61..58..82..79...
. . .
The start of the sequence as triangle array read by rows:
1;
5,4;
2,3,6;
10,9,14,13;
7,8,11,12,15;
19,18,23,22,27,26;
16,17,20,21,24,25,28;
. . .
The start of the sequence as array read by rows, the length of row r is 4*r-3.
First 2*r-2 numbers are from the row number 2*r-2 of  triangle array, located above.
Last  2*r-1 numbers are from the row number 2*r-1 of  triangle array, located above.
1;
5,4,2,3,6;
10,9,14,13,7,8,11,12,15;
19,18,23,22,27,26,16,17,20,21,24,25,28;
. . .
Row number r contains permutation 4*r-3 numbers from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-5*r+7, 2*r*r-5*r+6,...2*r*r-r-4, 2*r*r-r-3, 2*r*r-r.
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->((k+n)^2-4*k+3+(-1)^k-2*(-1)^n-(k+n)*(-1)^(k+n))/2: seq(seq(T(k,n-k),k=1..n-1),n=1..13); # Muniru A Asiru, Dec 06 2018
  • Mathematica
    T[n_, k_] := ((n+k)^2 - 4k + 3 + (-1)^k - 2(-1)^n - (n+k)(-1)^(n+k))/2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 06 2018 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-4*j+3+(-1)**j-2*(-1)**i-(t+2)*(-1)**t)/2

Formula

As table
T(n,k) = ((k+n)^2-4*k+3+(-1)^k-2*(-1)^n-(k+n)*(-1)^(k+n))/2.
As linear sequence
a(n) = (A003057(n)^2-4*A004736(n)+3+(-1)^A004736(n)-2*(-1)^A002260(n)-A003057(n)*(-1)^A003056(n))/2;
a(n) = ((t+2)^2-4*j+3+(-1)^j-2*(-1)^i-(t+2)*(-1)^t)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).

A349095 Where ones occur in A349082. These correspond to rationals, 0 < p/q < 1, that have a unique solution, p/q = 1/x + 1/y, 0 < x < y.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 19, 25, 26, 27, 31, 32, 33, 34, 38, 40, 41, 42, 43, 46, 47, 48, 49, 51, 59, 61, 63, 64, 65, 67, 68, 73, 80, 82, 83, 85, 86, 87, 94, 96, 97, 100, 101, 110, 113, 114, 115, 117, 121, 122, 123, 126, 129, 142, 143, 144, 145, 146, 147, 148
Offset: 1

Views

Author

Jud McCranie, Dec 24 2021

Keywords

Comments

For index k, p/q = A002260(k)/A003057(k).

Examples

			6 is a term because A349082(6)=1, indicating that 3/4 = 1/x + 1/y has a unique solution, 1/2 + 1/4.
		

Crossrefs

A381562 Minimum 2-tone chromatic number of maximal planar graphs with n vertices.

Original entry on oeis.org

6, 8, 9, 9, 8, 8, 8, 8, 8, 8, 8, 7, 8, 8, 8, 7
Offset: 3

Views

Author

Allan Bickle, Feb 27 2025

Keywords

Comments

The 2-tone chromatic number of a graph G is the smallest number of colors for which G has a coloring where every vertex has two distinct colors, no adjacent vertices have a common color, and no pair of vertices at distance 2 have two common colors.
For n in {19,22,23,27}, a(n) is either 7 or 8. All larger values are 7.

Examples

			For n=3, all 3 vertices get two distinct colors, so a(3) = 6.
For n=4, all 4 vertices get two distinct colors, so a(3) = 8.
For n=5 or 6, the extremal graph is a double wheel.
		

Crossrefs

Cf. A003057, A351120 (pair coloring).
Cf. A350361 (trees), A350362 (cycles), A350715 (wheels), A366727 (outerplanar), A366728 (square of cycles).

Formula

a(n) = 7 for n > 27.

A123572 The Kruskal-Macaulay function K_3(n).

Original entry on oeis.org

0, 3, 5, 6, 6, 8, 9, 9, 10, 10, 10, 12, 13, 13, 14, 14, 14, 15, 15, 15, 15, 17, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 23, 24, 24, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 30, 31, 31, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 34
Offset: 0

Views

Author

N. J. A. Sloane, Nov 12 2006

Keywords

Comments

Write n (uniquely) as n = C(n_t,t) + C(n_{t-1},t-1) + ... + C(n_v,v) where n_t > n_{t-1} > ... > n_v >= v >= 1. Then K_t(n) = C(n_t,t-1) + C(n_{t-1},t-2) + ... + C(n_v,v-1).

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 4, Fascicle 3, Section 7.2.1.3, Table 3.

Crossrefs

For K_i(n), i=1, 2, 3, 4, 5 see A000012, A003057, A123572, A123573, A123574.

Programs

  • Maple
    lowpol := proc(n,t) local x::integer ; x := floor( (n*factorial(t))^(1/t)) ; while binomial(x,t) <= n do x := x+1 ; od ; RETURN(x-1) ; end: C := proc(n,t) local nresid,tresid,m,a ; nresid := n ; tresid := t ; a := [] ; while nresid > 0 do m := lowpol(nresid,tresid) ; a := [op(a),m] ; nresid := nresid - binomial(m,tresid) ; tresid := tresid-1 ; od ; RETURN(a) ; end: K := proc(n,t) local a ; a := C(n,t) ; add( binomial(op(i,a),t-i),i=1..nops(a)) ; end: A123572 := proc(n) K(n,3) ; end: for n from 0 to 80 do printf("%d, ",A123572(n)) ; od ; # R. J. Mathar, May 18 2007
  • Mathematica
    lowpol[n_, t_] := Module[{x}, x = Floor[(n*t!)^(1/t)]; While[Binomial[x, t] <= n, x = x + 1]; x - 1];
    c[n_, t_] := Module[{n0 = n, t0 = t, m, a = {}}, While[n0 > 0, m = lowpol[n0, t0]; a = Append[a, m]; n0 = n0 - Binomial[m, t0]; t0 = t0 - 1]; a];
    K[n_, t_] := Module[{a}, a = c[n, t]; Sum[Binomial[a[[i]], t - i], {i, 1, Length[a]}]];
    A123572[n_] := K[n, 3];
    Table[A123572[n], {n, 0, 80}] (* Jean-François Alcover, Mar 22 2023, after R. J. Mathar *)

Extensions

More terms from R. J. Mathar, May 18 2007

A123573 The Kruskal-Macaulay function K_4(n).

Original entry on oeis.org

0, 4, 7, 9, 10, 10, 13, 15, 16, 16, 18, 19, 19, 20, 20, 20, 23, 25, 26, 26, 28, 29, 29, 30, 30, 30, 32, 33, 33, 34, 34, 34, 35, 35, 35, 35, 38, 40, 41, 41, 43, 44, 44, 45, 45, 45, 47, 48, 48, 49, 49, 49, 50, 50, 50, 50, 52, 53, 53, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 56
Offset: 0

Views

Author

N. J. A. Sloane, Nov 12 2006

Keywords

Comments

Write n (uniquely) as n = C(n_t,t) + C(n_{t-1},t-1) + ... + C(n_v,v) where n_t > n_{t-1} > ... > n_v >= v >= 1. Then K_t(n) = C(n_t,t-1) + C(n_{t-1},t-2) + ... + C(n_v,v-1).

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 4, Fascicle 3, Section 7.2.1.3, Table 3.

Crossrefs

For K_i(n), i=1, 2, 3, 4, 5 see A000012, A003057, A123572, A123573, A123574.

Programs

  • Maple
    lowpol := proc(n,t) local x::integer ; x := floor( (n*factorial(t))^(1/t)) ; while binomial(x,t) <= n do x := x+1 ; od ; RETURN(x-1) ; end: C := proc(n,t) local nresid,tresid,m,a ; nresid := n ; tresid := t ; a := [] ; while nresid > 0 do m := lowpol(nresid,tresid) ; a := [op(a),m] ; nresid := nresid - binomial(m,tresid) ; tresid := tresid-1 ; od ; RETURN(a) ; end: K := proc(n,t) local a ; a := C(n,t) ; add( binomial(op(i,a),t-i),i=1..nops(a)) ; end: A123573 := proc(n) K(n,4) ; end: for n from 0 to 80 do printf("%d, ",A123573(n)) ; od ; # R. J. Mathar, May 18 2007
  • Mathematica
    lowpol[n_, t_] := Module[{x}, x = Floor[(n*t!)^(1/t)]; While[Binomial[x, t] <= n, x = x + 1]; x - 1];
    c[n_, t_] := Module[{n0 = n, t0 = t, m, a = {}}, While[n0 > 0, m = lowpol[n0, t0]; a = Append[a, m]; n0 = n0 - Binomial[m, t0]; t0 = t0 - 1]; a];
    K[n_, t_] := Module[{a}, a = c[n, t]; Sum[Binomial[a[[i]], t - i], {i, 1, Length[a]}]];
    A123573[n_] := K[n, 4];
    Table[A123573[n], {n, 0, 70}] (* Jean-François Alcover, Mar 30 2023, after R. J. Mathar *)

Extensions

More terms from R. J. Mathar, May 18 2007

A123574 The Kruskal-Macaulay function K_5(n).

Original entry on oeis.org

0, 5, 9, 12, 14, 15, 15, 19, 22, 24, 25, 25, 28, 30, 31, 31, 33, 34, 34, 35, 35, 35, 39, 42, 44, 45, 45, 48, 50, 51, 51, 53, 54, 54, 55, 55, 55, 58, 60, 61, 61, 63, 64, 64, 65, 65, 65, 67, 68, 68, 69, 69, 69, 70, 70, 70, 70, 74, 77, 79, 80, 80, 83, 85, 86, 86, 88, 89, 89, 90
Offset: 0

Views

Author

N. J. A. Sloane, Nov 12 2006

Keywords

Comments

Write n (uniquely) as n = C(n_t,t) + C(n_{t-1},t-1) + ... + C(n_v,v) where n_t > n_{t-1} > ... > n_v >= v >= 1. Then K_t(n) = C(n_t,t-1) + C(n_{t-1},t-2) + ... + C(n_v,v-1).

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 4, Fascicle 3, Section 7.2.1.3, Table 3.

Crossrefs

For K_i(n), i=1, 2, 3, 4, 5 see A000012, A003057, A123572, A123573, A123574.

Programs

  • Maple
    lowpol := proc(n,t) local x::integer ; x := floor( (n*factorial(t))^(1/t)) ; while binomial(x,t) <= n do x := x+1 ; od ; RETURN(x-1) ; end: C := proc(n,t) local nresid,tresid,m,a ; nresid := n ; tresid := t ; a := [] ; while nresid > 0 do m := lowpol(nresid,tresid) ; a := [op(a),m] ; nresid := nresid - binomial(m,tresid) ; tresid := tresid-1 ; od ; RETURN(a) ; end: K := proc(n,t) local a ; a := C(n,t) ; add( binomial(op(i,a),t-i),i=1..nops(a)) ; end: A123574 := proc(n) K(n,5) ; end: for n from 0 to 80 do printf("%d, ",A123574(n)) ; od ; # R. J. Mathar, May 18 2007
  • Mathematica
    lowpol[n_, t_] := Module[{x}, x = Floor[(n*t!)^(1/t)]; While[Binomial[x, t] <= n, x = x + 1]; x - 1];
    c[n_, t_] := Module[{n0 = n, t0 = t, m, a = {}}, While[n0 > 0, m = lowpol[n0, t0]; a = Append[a, m]; n0 = n0 - Binomial[m, t0]; t0 = t0 - 1]; a];
    K[n_, t_] := Module[{a}, a = c[n, t]; Sum[Binomial[a[[i]], t - i], {i, 1, Length[a]}]];
    A123574[n_] := K[n, 5];
    Table[A123574[n], {n, 0, 69}] (* Jean-François Alcover, Mar 30 2023, after R. J. Mathar *)

Extensions

More terms from R. J. Mathar, May 18 2007

A130829 2n+1 appears 2n times.

Original entry on oeis.org

3, 3, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17
Offset: 1

Views

Author

Paul Curtz, Jul 17 2007

Keywords

Crossrefs

Programs

  • Maple
    seq(2*n+1 $ 2*n, n=1..10); # Robert Israel, Jan 14 2015
  • Python
    from math import isqrt
    def A130829(n): return 1|((m:=isqrt(n))+int((n-m*(m+1)<<2)>=1)<<1) # Chai Wah Wu, Oct 17 2022

Formula

a(n) = 2*floor(sqrt(n)+1/2)+1. - Mikael Aaltonen, Jan 14 2015
From Robert Israel, Jan 14 2015: (Start)
G.f.: (x/(1-x))*(1+2*Sum_{m>=0} x^(m*(m+1))) = (x/(1-x))*(1+x^(-1/4)*theta_2(0,x)) where theta_2 is the second Jacobi theta function.
a(2n) = a(2n-1) = 2*A002024(n)+1.
a(n) = A001670(n)+1.
(End)

A133196 n+2 repeated n times.

Original entry on oeis.org

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

Views

Author

Paul Curtz, Oct 09 2007

Keywords

Crossrefs

Programs

  • Mathematica
    Table[PadRight[{},n,n+2],{n,20}]//Flatten (* Harvey P. Dale, Sep 04 2019 *)
  • Python
    from math import isqrt
    def A133196(n): return 2+(isqrt(8*n)+1)//2 # Chai Wah Wu, Oct 17 2022

Formula

a(n) = A003056(n)+3, a(n) = A003057(n)+1; a(n) = t+3, where t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, May 07 2013

A221215 T(n,k)= ((n+k)^2-2*(n+k)+4-(n+3*k-2)*(-1)^(n+k))/2; n , k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 22 2013

Keywords

Comments

Permutation of the natural numbers.
a(n) is a pairing function: a function that reversibly maps Z^{+} x Z^{+} onto Z^{+}, where Z^{+} is the set of integer positive numbers.
Enumeration table T(n,k). Let m be natural number. The order of the list:
T(1,1)=1;
T(1,3), T(2,2), T(3,1);
T(2,1), T(1,2);
. . .
T(1,2*m+1), T(2,2*m), T(3,2*m-1), ... T(2*m+1,1);
T(2*m,1), T(2*m-1,2), T(2*m-2,3),...T(1,2*m);
. . .
First row contains elements antidiagonal {T(1,2*m+1), ... T(2*m+1,1)}, read downwards.
second row contains elements antidiagonal {T(1,2*m), ... T(2*m,1)}, read upwards.
The same as A211394, except for reversed order in even diagonals. - M. F. Hasler, Feb 26 2013

Examples

			The start of the sequence as table:
1....6...2..15...7..28..16...
5....3..14...8..27..17..44...
4...13...9..26..18..43..31...
12..10..25..19..42..32..63...
11..24..20..41..33..62..50...
23..21..40..34..61..51..86...
22..39..35..60..52..85..73...
. . .
The start of the sequence as triangle array read by rows:
1;
6,5;
2,3,4;
15,14,13,12;
7,8,9,10,11;
28,27,26,25,24,23;
16,17,18,19,20,21,22;
. . .
Row number r contains r consecutive numbers.
If r is odd,  row is increasing.
If r is even, row is decreasing.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := ((n+k)^2 - 2(n+k) + 4 - (n+3k-2)(-1)^(n+k))/2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jan 05 2019 *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    result=((t+2)**2-2*(t+2)+4-(i+3*j-2)*(-1)**t)/2

Formula

As table
T(n,k)= ((n+k)^2-2*(n+k)+4-(n+3*k-2)*(-1)^(n+k))/2.
As linear sequence
a(n) = (A003057(n)^2-2*A003057(n)+4-(A002260(n)+3*A004736(n)-2)*(-1)^A003056(n))/2; a(n) = ((t+2)^2-2*(t+2)+4-(i+3*j-2)*(-1)^t)/2,
where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2).
Previous Showing 31-40 of 55 results. Next