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

A374010 a(n) = (1 + (n+8)^2 + (n-9)*(-1)^n)/2.

Original entry on oeis.org

45, 47, 64, 70, 87, 97, 114, 128, 145, 163, 180, 202, 219, 245, 262, 292, 309, 343, 360, 398, 415, 457, 474, 520, 537, 587, 604, 658, 675, 733, 750, 812, 829, 895, 912, 982, 999, 1073, 1090, 1168, 1185, 1267, 1284, 1370, 1387, 1477, 1494, 1588, 1605, 1703, 1720, 1822
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 24 2024

Keywords

Comments

Fill an array with the natural numbers n = 1,2,... along diagonals in alternating 'down' and 'up' directions. a(n) is row 9 of the boustrophedon-style array (see example).
In general, row k is given by (1+t^2+(n-k)*(-1)^t)/2, t = n+k-1. Here, k=9.

Examples

			       [ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [ 7] [ 8] [ 9] [10] [11] [12]
  [ 1]   1    3    4   10   11   21   22   36   37   55   56   78   ...
  [ 2]   2    5    9   12   20   23   35   38   54   57   77   ...
  [ 3]   6    8   13   19   24   34   39   53   58   76   ...
  [ 4]   7   14   18   25   33   40   52   59   75   ...
  [ 5]  15   17   26   32   41   51   60   74   ...
  [ 6]  16   27   31   42   50   61   73   ...
  [ 7]  28   30   43   49   62   72   ...
  [ 8]  29   44   48   63   71   ...
  [ 9]  45   47   64   70   ...
  [10]  46   65   69   ...
  [11]  66   68   ...
  [12]  67   ...
        ...
		

Crossrefs

For rows k = 1..10: A131179 (k=1) n>0, A373662 (k=2), A373663 (k=3), A374004 (k=4), A374005 (k=5), A374007 (k=6), A374008 (k=7), A374009 (k=8), this sequence (k=9), A374011 (k=10).
Row 9 of the table in A056011.
Column 9 of the rectangular array in A056023.

Programs

  • Magma
    [(1 + (n+8)^2 + (n-9)*(-1)^n)/2: n in [1..80]];
  • Mathematica
    CoefficientList[Series[-(28*x^4 + 2*x^3 - 73*x^2 + 2*x + 45)/((x + 1)^2*(x - 1)^3), {x, 0, 50}], x]
    k := 9; Table[(1 + (n + k - 1)^2 + (n - k) (-1)^(n + k - 1))/2, {n, 80}]

Formula

a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
G.f.: -x*(28*x^4+2*x^3-73*x^2+2*x+45)/((x+1)^2*(x-1)^3).
a(n) = A374009(n+1) - (-1)^n.

A374011 a(n) = (1 + (n+9)^2 - (n-10)*(-1)^n)/2.

Original entry on oeis.org

46, 65, 69, 88, 96, 115, 127, 146, 162, 181, 201, 220, 244, 263, 291, 310, 342, 361, 397, 416, 456, 475, 519, 538, 586, 605, 657, 676, 732, 751, 811, 830, 894, 913, 981, 1000, 1072, 1091, 1167, 1186, 1266, 1285, 1369, 1388, 1476, 1495, 1587, 1606, 1702, 1721, 1821
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 24 2024

Keywords

Comments

Fill an array with the natural numbers n = 1,2,... along diagonals in alternating 'down' and 'up' directions. a(n) is row 10 of the boustrophedon-style array (see example).
In general, row k is given by (1+t^2+(n-k)*(-1)^t)/2, t = n+k-1. Here, k=10.

Examples

			       [ 1] [ 2] [ 3] [ 4] [ 5] [ 6] [ 7] [ 8] [ 9] [10] [11] [12]
  [ 1]   1    3    4   10   11   21   22   36   37   55   56   78   ...
  [ 2]   2    5    9   12   20   23   35   38   54   57   77   ...
  [ 3]   6    8   13   19   24   34   39   53   58   76   ...
  [ 4]   7   14   18   25   33   40   52   59   75   ...
  [ 5]  15   17   26   32   41   51   60   74   ...
  [ 6]  16   27   31   42   50   61   73   ...
  [ 7]  28   30   43   49   62   72   ...
  [ 8]  29   44   48   63   71   ...
  [ 9]  45   47   64   70   ...
  [10]  46   65   69   ...
  [11]  66   68   ...
  [12]  67   ...
        ...
		

Crossrefs

For rows k = 1..10: A131179 (k=1) n>0, A373662 (k=2), A373663 (k=3), A374004 (k=4), A374005 (k=5), A374007 (k=6), A374008 (k=7), A374009 (k=8), A374010 (k=9), this sequence (k=10).
Row 10 of the table in A056011.
Column 10 of the rectangular array in A056023.

Programs

  • Magma
    [(1 + (n+9)^2 - (n-10)*(-1)^n)/2: n in [1..80]];
  • Mathematica
    CoefficientList[Series[-(46*x^4 - 19*x^3 - 88*x^2 + 19*x + 46)/((x + 1)^2*(x - 1)^3), {x, 0, 50}], x]
    k := 10; Table[(1 + (n + k - 1)^2 + (n - k) (-1)^(n + k - 1))/2, {n, 80}]

Formula

a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
G.f.: -x*(46*x^4-19*x^3-88*x^2+19*x+46)/((x+1)^2*(x-1)^3).
a(n) = A374010(n+1) + (-1)^n.

A092542 Table whose n-th row is constant and equal to n, read by antidiagonals alternately upwards and downwards.

Original entry on oeis.org

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

Views

Author

Sam Alexander, Feb 27 2004

Keywords

Comments

Let A be sequence A092542 (this sequence) and B be sequence A092543 (1, 2, 1, 1, 2, 3, 4, ...). Under upper trimming or lower trimming, A transforms into B and B transforms into A. Also, B gives the number of times each element of A appears. For example, A(7) = 1 and B(7) = 4 because the 1 in A(7) is the fourth 1 to appear in A. - Kerry Mitchell, Dec 28 2005
First inverse function (numbers of rows) for pairing function A056023 and second inverse function (numbers of columns) for pairing function A056011. - Boris Putievskiy, Dec 24 2012
The rational numbers a(n)/A092543(n) can be systematically ordered and numbered in this way, as Georg Cantor first proved in 1873. - Martin Renner, Jun 05 2016

Examples

			The table
  1 1 1 1 1 ...
  2 2 2 2 2 ...
  3 3 3 3 3 ...
  4 4 4 4 4 ...
gives
  1;
  1 2;
  3 2 1;
  1 2 3 4;
  5 4 3 2 1;
  1 2 3 4 5 6;
		

References

  • Amir D. Aczel, "The Mystery of the Aleph, Mathematics, the Kabbalah and the Search for Infinity", Barnes & Noble, NY 2000, page 112.

Crossrefs

Variants of Cantor's enumeration are: A352911, A366191, A319571, A354266.

Programs

  • Mathematica
    Table[ Join[Range[2n - 1], Reverse@ Range[2n - 2]], {n, 8}] // Flatten (* Robert G. Wilson v, Sep 28 2006 *)

Formula

a(n) = ((-1)^t+1)*j/2-((-1)^t-1)*i/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 24 2012

Extensions

Name edited by Michel Marcus, Dec 14 2023

A188568 Enumeration table T(n,k) by descending antidiagonals. The order of the list - if n is odd: T(n,1), T(2,n-1), T(n-2,3), ..., T(n-1,2), T(1,n); if n is even: T(1,n), T(n-1,2), T(3,n-2), ..., T(2,n-1), T(n,1).

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Dec 27 2012

Keywords

Comments

Self-inverse 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.
Call a "layer" a pair of sides of square from T(1,n) to T(n,n) and from T(n,n) to T(n,1). This table read layer by layer clockwise is A194280. This table read by boustrophedonic ("ox-plowing") method - layer clockwise, layer counterclockwise and so on - is A064790. - Boris Putievskiy, Mar 14 2013

Examples

			The start of the sequence as table:
   1,  2,  6,  7, 15, 16, 28, ...
   3,  5,  9, 12, 20, 23, 35, ...
   4,  8, 13, 18, 26, 31, 43, ...
  10, 14, 19, 25, 33, 40, 52, ...
  11, 17, 24, 32, 41, 50, 62, ...
  21, 27, 34, 42, 51, 61, 73, ...
  22, 30, 39, 49, 60, 72, 85, ...
  ...
The start of the sequence as triangular array read by rows:
   1;
   2,  3;
   6,  5,  4;
   7,  9,  8, 10;
  15, 12, 13, 14, 11;
  16, 20, 18, 19, 17, 21;
  28, 23, 26, 25, 24, 27, 22;
  ...
Row number k contains permutation of the k numbers:
{ (k^2-k+2)/2, (k^2-k+2)/2 + 1, ..., (k^2+k-2)/2 + 1 }.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{t, i, j},
    t = Floor[(Sqrt[8n-7]-1)/2];
    i = n-t(t+1)/2;
    j = (t^2+3t+4)/2-n;
    ((i+j-1)(i+j-2) + ((-1)^Max[i,j]+1)i - ((-1)^Max[i,j]-1)j)/2];
    Array[a, 55] (* Jean-François Alcover, Jan 26 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
    m=((i+j-1)*(i+j-2)+((-1)**max(i,j)+1)*i-((-1)**max(i,j)-1)*j)/2

Formula

a(n) = ((i+j-1)*(i+j-2)+((-1)^max(i,j)+1)*i-((-1)^max(i,j)-1)*j)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor[(-1+sqrt(8*n-7))/2].

A092543 Table below read by antidiagonals alternately upwards and downwards.

Original entry on oeis.org

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

Views

Author

Sam Alexander, Feb 27 2004

Keywords

Comments

1 2 3 4 5 ...
1 2 3 4 5 ...
1 2 3 4 5 ...
1 2 3 4 5 ...
...
Let A be sequence A092543 (this sequence) and B be sequence A092542 (1, 1, 2, 3, 2, 1, 1, ...). Under upper trimming or lower trimming, A transforms into B and B transforms into A. Also, B gives the number of times each element of A appears. For example, A(4) = 1 and B(4) = 3 because the 1 in A(4) is the third 1 to appear in A. - Kerry Mitchell, Dec 28 2005
First inverse function (numbers of rows) for pairing function A056011 and second inverse function (numbers of columns) for pairing function A056023. - Boris Putievskiy, Dec 24 2012
The rational numbers A092542(n)/a(n) can be systematically ordered and numbered in this way, as Georg Cantor first proved in 1873. - Martin Renner, Jun 05 2016

References

  • Amir D. Aczel, "The Mystery of the Aleph, Mathematics, the Kabbalah and the Search for Infinity", Barnes & Noble, NY 2000, page 112.

Crossrefs

Programs

  • Maple
    seq(seq(i-abs(i-j),j=1..2*i-1),i=2..20,2); # Robert Israel, Mar 01 2016
  • Mathematica
    Table[ Join[Range[2n], Reverse@Range[2n - 1]], {n, 7}] // Flatten (* Robert G. Wilson v, Sep 28 2006 *)

Formula

T(r,c)=c.
A092542(n)+a(n) = 1+A002024(n). - Enrique Pérez Herrero, Apr 01 2010
a(n) = ((-1)^t+1)*i/2-((-1)^t-1)*j/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 24 2012
G.f.: (1-x)^(-2)*Sum_{i>=0} x^(2*i^2+i+1)*(1-x^(2*i+2))^2. - Robert Israel, Mar 01 2016

A185180 Enumeration table T(n,k) by antidiagonals. The order of the list is symmetrical movement from center to edges diagonal.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Dec 26 2012

Keywords

Comments

The natural numbers are grouped in chunks of 1, 2, 3, 4,... as (1), (2,3), (4,5,6), (7,8,9,10), etc and each group fills a diagonal in the table. The smallest number in a group is in A000124, the largest in A000217. Numbers in a group are placed on free spots as close as possible to the middle of the diagonal, given preference to the smaller row numbers in the table if there is a draw.
The resulting array is apparently a transposed version of A064789 (if this was also written as an array).
The order of the list table T(n,k):
if n is odd:
T (floor(n+1)/2,floor(n+1)/2), T(floor(n+1)/2-1,floor(n+1)/2+1), T(floor(n+1)/2+1,floor(n+1)/2-1),...T(1,n), T(n,1)
if n is even:
T(floor(n+1)/2-1,floor(n+1)/2+1), T(floor(n+1)/2+1,floor(n+1)/2-1),...T(1,n), T(n,1).
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.

Examples

			The start of the sequence as table:
  1....2....5....9...14...20...27 ...
  3....4....7...12...18...25...33 ...
  6....8...11...16...23...31...40 ...
  10..13...17...22...29...38...48 ...
  15..19...24...30...37...46...57 ...
  21..26...32...39...47...56...67 ...
  28..34...41...49...58...68...79 ...
  ...
The start of the sequence as triangle array read by rows:
  1;
  2,   3;
  5,   4,  6;
  9,   7,  8, 10;
  14, 12, 11, 13, 15;
  20, 18, 16, 17, 19, 21;
  27, 25, 23, 22, 24, 26, 28;
. . .
Row number k (k > 1) of the triangle contains a permutation of the set of k numbers from (k^2-k+2)/2, (k^2-k+2)/2 + 1 ,...up to (k^2+k-2)/2 + 1, namely (k^2+k-2)/2, (k^2+k-2)/2 -2,...,(k^2-k+2)/2, (k^2-k+2)/2 + 2,..., (k^2+k-2)/2-1, (k^2+k-2)/2+1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{i, j, t}, i = n - t(t+1)/2; j = (t^2 + 3t + 4)/2 - n; t = Floor[(-1 + Sqrt[8n - 7])/2]; If[j <= i, (i(i+1) + (j-1)(j + 2i - 4))/2, (i(i+1) + (j-1)(j + 2i - 4))/2 + 2(j-i) - 1]];
    Array[a, 68] (* Jean-François Alcover, Nov 21 2018, from Python *)
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    j=(t*t+3*t+4)/2-n
    if j<=i:
       m=(i*(i+1) + (j-1)*(j+2*i-4))/2
    else:
       m=(i*(i+1) + (j-1)*(j+2*i-4))/2 +2*(j-i)-1

Formula

a(n) = (i*(i+1) + (j-1)*(j+2*i-4))/2, if j<=i, a(n)=(i*(i+1) + (j-1)*(j+2*i-4))/2 +2*(j-i)-1, if j>i, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor[(-1+sqrt(8*n-7))/2].

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

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 19 2013

Keywords

Comments

Self-inverse 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.
In general, let m be natural number. Natural numbers placed in table T(n,k) by antidiagonals. The order of placement - at the beginning m antidiagonals downwards, next m antidiagonals upwards and so on. T(n,k) read by antidiagonals downwards.
For m = 1 the result is A056011. This sequence is result for m = 2.
A056023 is result for m = 1 and the changed order of placement - at the beginning m antidiagonals upwards, next m antidiagonals downwards and so on.

Examples

			The start of the sequence as table.  The direction of the placement denotes by ">" and  "v".
  v...v          v...v
..1...2...6..10..11..16..28..36...
..3...5...9..12..17..27..35..38...
> 4...8..13..18..26..34..39..48...
> 7..14..19..25..33..40..49..63...
.15..20..24..32..41..50..62..74...
.21..23..31..42..51..61..73..84...
>22..30..43..52..60..72..85..98...
>29..44..53..59..71..86..99.113...
  . . .
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   6,  5,  4;
  10,  9,  8,  7;
  11, 12, 13, 14, 15;
  16, 17, 18, 19, 20, 21;
  28, 27, 26, 25, 24, 23, 22;
  36, 35, 34, 33, 32, 31, 30, 29;
  ...
Row r consists of r consecutive numbers from r*r/2 - r/2 + 1 to r*r/2 + r.
If r congruent to 1 or 2 mod 4 rows are increasing.
If r congruent to 0 or 3 mod 4 rows are decreasing.
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->((n+k-1)*(n+k-2)-(-1+(-1)^floor((n+k)/2))*n+(1+(-1)^floor((n+k)/2))*k)/2: seq(seq(T(k,n-k),k=1..n-1),n=1..13); # Muniru A Asiru, Dec 13 2018
  • Mathematica
    T[n_, k_] := ((n+k-1)(n+k-2) - (-1 + (-1)^Floor[(n+k)/2])n + (1 + (-1)^Floor[(n+k)/2]) k)/2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 06 2018 *)
  • Maxima
    T(n,k) = ((n + k - 1)*(n + k - 2) - (-1 + (-1)^floor((n + k)/2))*n + (1 +(-1)^floor((n + k)/2))*k)/2$
    create_list(T(k, n - k), n, 1, 12, k, 1, n - 1); /* Franck Maminirina Ramaharo, Dec 13 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
    z=i+j
    result=((z-1)*(z-2)-(-1+(-1)**int(z/2))*i+(1+(-1)**int(z/2))*j)/2
    

Formula

For the general case.
As a table
T(n,k) = ((n + k - 1)*(n + k - 2) - (-1 + (-1)^floor((n + k + m - 2)/m))*n + (1 +(-1)^floor((n + k + m - 2)/m))*k)/2.
As linear sequence
a(n) = ((z - 1)*(z - 2) - (-1 + (-1)^floor((z + m - 2)/m))*i + (1 + (-1)^floor((z + m - 2)/m))*j)/2, where i = n - t*(t + 1)/2, j = (t*t + 3*t + 4)/2 - n, t = floor((-1 + sqrt(8*n - 7))/2), z = i + j.
If we change the order of placement - m antidiagonals upwards, m antidiagonals downwards and so on.
As a table
T(n,k) = ((n + k - 1)*(n + k - 2) - (-1 + (-1)^(floor((n + k + m - 2)/m) + 1))*n + (1 + (-1)^(floor((n + k + m - 2)/m) + 1))*k)/2.
As linear sequence
a(n) = ((z - 1)*(z - 2) - (-1 + (-1)^(floor((z + m - 2)/m) + 1))*i + (1 + (-1)^(floor((z + m - 2)/m) + 1))*j)/2, where i = n - t*(t + 1)/2, j = (t*t + 3*t + 4)/2 - n, t = floor((-1 + sqrt(8*n - 7))/2), z = i + j.
For this sequence.
As a table
T(n,k) = ((n + k - 1)*(n + k - 2) - (-1 +(-1)^floor((n + k)/2))*n + (1 + (-1)^floor((n + k)/2))*k)/2.
As linear sequence
a(n) = ((z - 1)*(z - 2) - (-1 + (-1)^floor(z/2))*i + (1 + (-1)^floor(z/2))*j)/2, where i = n - t*(t + 1)/2, j = (t*t + 3*t + 4)/2 - n, t = floor((-1 + sqrt(8*n - 7))/2), z = i + j.

A079826 Consider the triangle shown below; sequence contains the concatenation of numbers read at a 45-degree angle upwards with horizontal beginning with the first term of a row.

Original entry on oeis.org

1, 3, 42, 105, 1196, 21128, 2220137, 36231914, 3735241815, 5538342517, 565439332616, 785753403227, 79775852413128, 105807659514230, 106104817560504329, 1361071038274614944
Offset: 1

Views

Author

Amarnath Murthy, Feb 11 2003

Keywords

Comments

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

Crossrefs

Programs

  • Maple
    read("transforms") ;
    A079826 := proc(n)
            local L, k;
            L := [] ;
            for k from 1 to (n+1)/2 do
                    L := [op(L),A056011(n-k+1,k)] ;
            end do:
            digcatL(L) ;
    end proc: # R. J. Mathar, Sep 05 2012

Extensions

More terms from Jonathan R. Love (japanada11(AT)yahoo.ca), Mar 08 2007
Corrected by Kevin Ryde, Aug 23 2012

A213927 T(n,k) = (z*(z-1)-(-1+(-1)^(z^2 mod 3))*n+(1+(-1)^(z^2 mod 3))*k)/2, where z=n+k-1; n, k > 0, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Mar 06 2013

Keywords

Comments

Self-inverse 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.
In general, let b(z) be a sequence of integers and denote number of antidiagonal table T(n,k) by z=n+k-1. Natural numbers placed in table T(n,k) by antidiagonals. The order of placement - by antidiagonal downwards, if b(z) is odd; by antidiagonal upwards, if b(z) is even. T(n,k) read by antidiagonals downwards. For A218890 -- the order of placement -- at the beginning m antidiagonals downwards, next m antidiagonals upwards and so on - b(z)=floor((z+m-1)/m). For this sequence b(z)=z^2 mod 3. (This comment should be edited for clarity, Joerg Arndt, Dec 11 2014)

Examples

			The start of the sequence as table.
The direction of the placement denoted by ">" and  "v".
.v.....v       v...v        v....v
.1.....2...6...7..11...21...22...29...45...
.3.....5...8..12..20...23...30...44...47...
>4.....9..13..19..24...31...43...48...58...
.10...14..18..25..32...42...49...59...75...
.15...17..26..33..41...50...60...74...83...
>16...27..34..40..51...61...73...84...97...
.28...35..39..52..62...72...85...98..114...
.36...38..53..63..71...86...99..113..128...
>37...54..64..70..87..100..112..129..145...
...
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   6,  5,  4;
   7,  8,  9, 10;
  11, 12, 13, 14, 15;
  21, 20, 19, 18, 17, 16;
  22, 23, 24, 25, 26, 27, 28;
  29, 30, 31, 32, 33, 34, 35, 36;
  45, 44, 43, 42, 41, 40, 39, 38, 37;
  ...
Row r consists of r consecutive numbers from r*r/2-r/2+1 to r*r/2+r.
If r is not divisible by 3, rows are increasing.
If r is     divisible by 3, rows are decreasing.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := With[{z = n + k - 1}, (z*(z - 1) - (-1 + (-1)^Mod[z^2, 3])*n + (1 + (-1)^Mod[z^2, 3])*k)/2];
    Table[T[n - k + 1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jul 22 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
    z=i+j-1
    result=(z*(z-1)-(-1+(-1)**(z**2%3))*i+(1+(-1)**(z**2%3))*j)/2

Formula

For the general case.
T(n,k) = (z*(z-1)-(-1+(-1)^b(z))*n+(1+(-1)^b(z))*k)/2, where z=n+k-1 (as a table).
a(n) = (z*(z-1)-(-1+(-1)^b(z))*i+(1+(-1)^b(z))*j)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2), z=i+j-1 (as a linear sequence).
For this sequence b(z)=z^2 mod 3.
T(n,k) = (z*(z-1)-(-1+(-1)^(z^2 mod 3))*n+(1+(-1)^(z^2 mod 3))*k)/2, where z=n+k-1 (as a table).
a(n) = (z*(z-1)-(-1+(-1)^(z^2 mod 3))*i+(1+(-1)^(z^2 mod 3))*j)/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2), z=i+j-1 (as linear sequence).

A079825 Sum of numbers in n-th upward diagonal of triangle in A079826.

Original entry on oeis.org

1, 3, 6, 15, 26, 41, 62, 92, 129, 169, 224, 287, 366, 443, 548, 656, 793, 919, 1090, 1255, 1466, 1653, 1906, 2140, 2441, 2701, 3052, 3367, 3774, 4119, 4584, 4992, 5521, 5963, 6558, 7071, 7738, 8289, 9030, 9660, 10481, 11153, 12056, 12815, 13806, 14611, 15692, 16592
Offset: 1

Views

Author

Amarnath Murthy, Feb 11 2003

Keywords

Crossrefs

Programs

  • Magma
    m:=35; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+2*x+2*x^2+7*x^3+6*x^4+2*x^5+6*x^6+x^7+x^8)/((x^2+1)^2*(1+x)^3*(x-1)^4))); // Bruno Berselli, Sep 05 2012
    
  • Magma
    [((2*n+1)*(7*n^2+7*n+12) -3*(-1)^n*n*(n-7) +6*(-1)^Binomial(n,2)*(2*n-3*(-1)^n+1))/96: n in [1..41]]; // G. C. Greubel, Dec 10 2023
    
  • Maple
    A079825 := proc(n)
            local a, k;
            a := 0 ;
            for k from 1 to (n+1)/2 do
                    a := a+A056011(n-k+1,k) ;
            end do:
            a ;
    end proc: # R. J. Mathar, Sep 05 2012
  • Mathematica
    LinearRecurrence[{1, 1, -1, 2, -2, -2, 2, -1, 1, 1, -1}, {1, 3, 6, 15, 26, 41, 62, 92, 129, 169, 224}, 35] (* Bruno Berselli, Sep 05 2012 *)
  • Maxima
    makelist(expand(((2*n+1)*(7*n^2+7*n+12)-3*n*(n-7)*(-1)^n+6*(2*n-3*(-1)^n+1)*%i^(n*(n-1)))/96), n, 1, 35); /* Bruno Berselli, Sep 05 2012 */
    
  • SageMath
    [((2*n+1)*(7*n^2+7*n+12)-3*(-1)^n*n*(n-7)+6*(-1)^binomial( n,2)*(2*n-3*(-1)^n+1))/96 for n in range(1,41)] # G. C. Greubel, Dec 10 2023

Formula

G.f.: x*( 1+2*x+2*x^2+7*x^3+6*x^4+2*x^5+6*x^6+x^7+x^8 ) / ( (1+x)^3*(1-x)^4*(1+x^2)^2 ). - R. J. Mathar, Sep 05 2012
a(n) = ( (2*n+1)*(7*n^2+7*n+12) -3*n*(n-7)*(-1)^n +6*(2*n-3*(-1)^n+1)*i^(n*(n-1)) )/96, where i=sqrt(-1). - Bruno Berselli, Sep 05 2012
E.g.f.: (1/48)*( (6+24*x+30*x^2+7*x^3)*cosh(x) + (6+42*x+33*x^2+7*x^3)* sinh(x) + 6*(x-1)*cos(x) - 6*(x-2)*sin(x) ). - G. C. Greubel, Dec 10 2023
Previous Showing 11-20 of 21 results. Next