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.

Showing 1-10 of 20 results. Next

A317186 One of many square spiral sequences: a(n) = n^2 + n - floor((n-1)/2).

Original entry on oeis.org

1, 2, 6, 11, 19, 28, 40, 53, 69, 86, 106, 127, 151, 176, 204, 233, 265, 298, 334, 371, 411, 452, 496, 541, 589, 638, 690, 743, 799, 856, 916, 977, 1041, 1106, 1174, 1243, 1315, 1388, 1464, 1541, 1621, 1702, 1786, 1871, 1959, 2048, 2140, 2233, 2329, 2426
Offset: 0

Views

Author

N. J. A. Sloane, Jul 27 2018

Keywords

Comments

Draw a square spiral on a piece of graph paper, and label the cells starting at the center with the positive (resp. nonnegative) numbers. This produces two versions of the labeled square spiral, shown in the Example section below.
The spiral may proceed clockwise or counterclockwise, and the first arm of the spiral may be along any of the four axes, so there are eight versions of each spiral. However, this has no effect on the resulting sequences, and it is enough to consider just two versions of the square spiral (starting at 1 or starting at 0).
The present sequence is obtained by reading alternate entries on the X-axis (say) of the square spiral started at 1.
The cross-references section lists many sequences that can be read directly off the two spirals. Many other sequences can be obtained from them by using them to extract subsequences from other important sequences. For example, the subsequence of primes indexed by the present sequence gives A317187.
a(n) is also the number of free polyominoes with n + 4 cells whose difference between length and width is n. In this comment the length is the longer of the two dimensions and the width is the shorter of the two dimensions (see the examples of polyominoes). Hence this is also the diagonal 4 of A379625. - Omar E. Pol, Jan 24 2025
From John Mason, Feb 19 2025: (Start)
The sequence enumerates polyominoes of width 2 having precisely 2 horizontal bars. By classifying such polyominoes according to the following templates, it is possible to define a formula that reduces to the one below:
.
OO O O
O OO OO
O O O
O O OO
OO OO O
.
(End)

Examples

			The square spiral when started with 1 begins:
.
  100--99--98--97--96--95--94--93--92--91
                                        |
   65--64--63--62--61--60--59--58--57  90
    |                               |   |
   66  37--36--35--34--33--32--31  56  89
    |   |                       |   |   |
   67  38  17--16--15--14--13  30  55  88
    |   |   |               |   |   |   |
   68  39  18   5---4---3  12  29  54  87
    |   |   |   |       |   |   |   |   |
   69  40  19   6   1---2  11  28  53  86
    |   |   |   |           |   |   |   |
   70  41  20   7---8---9--10  27  52  85
    |   |   |                   |   |   |
   71  42  21--22--23--24--25--26  51  84
    |   |                           |   |
   72  43--44--45--46--47--48--49--50  83
    |                                   |
   73--74--75--76--77--78--79--80--81--82
.
For the square spiral when started with 0, subtract 1 from each entry. In the following diagram this spiral has been reflected and rotated, but of course that makes no difference to the sequences:
.
   99  64--65--66--67--68--69--70--71--72
    |   |                               |
   98  63  36--37--38--39--40--41--42  73
    |   |   |                       |   |
   97  62  35  16--17--18--19--20  43  74
    |   |   |   |               |   |   |
   96  61  34  15   4---5---6  21  44  75
    |   |   |   |   |       |   |   |   |
   95  60  33  14   3   0   7  22  45  76
    |   |   |   |   |   |   |   |   |   |
   94  59  32  13   2---1   8  23  46  77
    |   |   |   |           |   |   |   |
   93  58  31  12--11--10---9  24  47  78
    |   |   |                   |   |   |
   92  57  30--29--28--27--26--25  48  79
    |   |                           |   |
   91  56--55--54--53--52--51--50--49  80
    |                                   |
   90--89--88--87--86--85--84--83--82--81
.
From _Omar E. Pol_, Jan 24 2025: (Start)
For n = 0 there is only one free polyomino with 0 + 4 = 4 cells whose difference between length and width is 0 as shown below, so a(0) = 1.
   _ _
  |_|_|
  |_|_|
.
For n = 1 there are two free polyominoes with 1 + 4 = 5 cells whose difference between length and width is 1 as shown below, so a(1) = 2.
   _ _     _ _
  |_|_|   |_|_|
  |_|_|   |_|_
  |_|     |_|_|
.
(End)
		

Crossrefs

Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.
Filling in these two squares spirals with greedy algorithm: A274640, A274641.
Cf. also A317187.

Programs

  • Mathematica
    a[n_] := n^2 + n - Floor[(n - 1)/2]; Array[a, 50, 0] (* Robert G. Wilson v, Aug 01 2018 *)
    LinearRecurrence[{2, 0, -2 , 1},{1, 2, 6, 11},50] (* or *)
    CoefficientList[Series[(- x^3 - 2 * x^2 - 1) / ((x - 1)^3 * (x + 1)), {x, 0, 50}], x] (* Stefano Spezia, Sep 02 2018 *)

Formula

From Daniel Forgues, Aug 01 2018: (Start)
a(n) = (1/4) * (4 * n^2 + 2 * n + (-1)^n + 3), n >= 0.
a(0) = 1; a(n) = - a(n-1) + 2 * n^2 - n + 2, n >= 1.
a(0) = 1; a(1) = 2; a(2) = 6; a(3) = 11; a(n) = 2 * a(n-1) - 2 * a(n-3) + a(n-4), n >= 4.
G.f.: (- x^3 - 2 * x^2 - 1) / ((x - 1)^3 * (x + 1)). (End)
E.g.f.: ((2 + 3*x + 2*x^2)*cosh(x) + (1 + 3*x + 2*x^2)*sinh(x))/2. - Stefano Spezia, Apr 24 2024
a(n)+a(n+1)=A033816(n). - R. J. Mathar, Mar 21 2025
a(n)-a(n-1) = A042948(n), n>=1. - R. J. Mathar, Mar 21 2025

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

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 07 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(1,2), T(2,1), T(2,2), T(3,1);
...
T(1,n), T(1,n-1), T(2,n-2), T(2,n-1), T(3,n-2), T(3,n-3)...T(n,1);
...
Descent by snake along two adjacent antidiagonal - step to the west, step to the southwest, step to the east, step to the southwest and so on. The length of each step is 1.
Table contains:
row 1 is alternation of elements A130883 and A033816,
row 2 accommodates elements A100037 in odd places;
column 1 is alternation of elements A000384 and A091823,
column 2 is alternation of elements A071355 and A014106,
column 3 accommodates elements A130861 in even places;
main diagonal accommodates elements A188135 in odd places,
diagonal 1, located above the main diagonal, is alternation of elements A033567 and A033566,
diagonal 2, located above the main diagonal, is alternation of elements A139271 and A033585.

Examples

			The start of the sequence as a table:
   1,  3,  2,   8,   7,  17,  16,  30,  29,  47,  46, ...
   4,  5,  9,  10,  18,  19,  31,  32,  48,  49,  69, ...
   6, 12, 11,  21,  20,  34,  33,  51,  50,  72,  71, ...
  13, 14, 22,  23,  35,  36,  52,  53,  73,  74,  98, ...
  15, 25, 24,  38,  37,  55,  54,  76,  75, 101, 100, ...
  26, 27, 39,  40,  56,  57,  77,  78, 102, 103, 131, ...
  28, 42, 41,  59,  58,  80,  79, 105, 104, 134, 133, ...
  43, 44, 60,  61,  81,  82, 106, 107, 135, 136, 168, ...
  45, 63, 62,  84,  83, 109, 108, 138, 137, 171, 170, ...
  64, 65, 85,  86, 110, 111, 139, 140, 172, 173, 209, ...
  66, 88, 87, 113, 112, 142, 141, 175, 174, 212, 211, ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   3,  4;
   2,  5,  6;
   8,  9, 12, 13;
   7, 10, 11, 14, 15;
  17, 18, 21, 22, 25, 26;
  16, 19, 20, 23, 24, 27, 28;
  30, 31, 34, 35, 38, 39, 42, 43;
  29, 32, 33, 36, 37, 40, 41, 44, 45;
  47, 48, 51, 52, 55, 56, 59, 60, 63, 64;
  46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66;
  ...
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 number 2*r-2 of the triangular array above.
Last  2*r-1 numbers are from row number 2*r-1 of the triangular array above.
   1;
   3,  4,  2,  5,  6;
   8,  9, 12, 13,  7, 10, 11, 14, 15;
  17, 18, 21, 22, 25, 26, 16, 19, 20, 23, 24, 27, 28;
  30, 31, 34, 35, 38, 39, 42, 43, 29, 32, 33, 36, 37, 40, 41, 44, 45;
  47, 48, 51, 52, 55, 56, 59, 60, 63, 64, 46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66;
  ...
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+5, 2*r*r-5*r+6,...2*r*r-r-4, 2*r*r-r-1, 2*r*r-r.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := ((k+n)^2 - 4k + 3 + (-1)^k - (k+n-2)(-1)^(k+n))/2;
    Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Nov 29 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-t*(-1)**(t+2))/2

Formula

As a table:
T(n,k) = ((k + n)^2 - 4*k + 3 + (-1)^k - (k + n - 2)*(-1)^(k + n))/2.
As a linear sequence:
a(n) = ((t + 2)^2 - 4*j + 3 + (-1)^j - t*(-1)^t)/2, where j = (t*t + 3*t + 4)/2 - n and t = int((sqrt(8*n - 7) - 1)/ 2).

A270868 a(n) = n^4 + 3*n^3 + 8*n^2 + 9*n + 2.

Original entry on oeis.org

2, 23, 92, 263, 614, 1247, 2288, 3887, 6218, 9479, 13892, 19703, 27182, 36623, 48344, 62687, 80018, 100727, 125228, 153959, 187382, 225983, 270272, 320783, 378074, 442727, 515348, 596567, 687038, 787439, 898472, 1020863, 1155362, 1302743, 1463804, 1639367
Offset: 0

Views

Author

Vincenzo Librandi, Apr 01 2016

Keywords

Crossrefs

Programs

  • Magma
    [n^4+3*n^3+8*n^2+9*n+2: n in [0..40]];
  • Maple
    A270868:=n->n^4 + 3*n^3 + 8*n^2 + 9*n + 2: seq(A270868(n), n=0..50); # Wesley Ivan Hurt, Apr 01 2016
  • Mathematica
    Table[n^4 + 3 n^3 + 8 n^2 + 9 n + 2, {n, 0, 40}]

Formula

G.f.: (2+13*x-3*x^2+13*x^3-x^4)/(1-x)^5.
a(n) = 5*a(n-1)-10*a(n-2)+10*a(n-3)-5*a(n-4)+a(n-5).
From G. C. Greubel, Apr 01 2016: (Start)
a(2*m) == 0 (mod 2).
a(4*m + 2) == 0 (mod 4).
E.g.f.: (2 +21*x +24*x^2 +9*x^3 +x^4)*exp(x). (End)
a(n)+a(n+2)-2*a(n+1) = 6*A033816(n+1). - Wesley Ivan Hurt, Apr 02 2016

A317303 Numbers k such that both Dyck paths of the symmetric representation of sigma(k) have a central peak.

Original entry on oeis.org

2, 7, 8, 9, 16, 17, 18, 19, 20, 29, 30, 31, 32, 33, 34, 35, 46, 47, 48, 49, 50, 51, 52, 53, 54, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 154, 155, 156, 157, 158, 159, 160
Offset: 1

Views

Author

Omar E. Pol, Aug 27 2018

Keywords

Comments

Also triangle read by rows which gives the odd-indexed rows of triangle A014132.
There are no triangular number (A000217) in this sequence.
For more information about the symmetric representation of sigma see A237593 and its related sequences.
Equivalently, numbers k with the property that both Dyck paths of the symmetric representation of sigma(k) have an odd number of peaks. - Omar E. Pol, Sep 13 2018

Examples

			Written as an irregular triangle in which the row lengths are the odd numbers, the sequence begins:
    2;
    7,   8,   9;
   16,  17,  18,  19,  20;
   29,  30,  31,  32,  33,  34,  35;
   46,  47,  48,  49,  50,  51,  52,  53,  54;
   67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77;
   92,  93,  94,  95,  96,  97,  98,  99, 100, 101, 102, 103, 104;
  121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135;
...
Illustration of initial terms:
-----------------------------------------------------------
   k   sigma(k)   Diagram of the symmetry of sigma
-----------------------------------------------------------
                    _         _ _ _             _ _ _ _ _
                  _| |       | | | |           | | | | | |
   2      3      |_ _|       | | | |           | | | | | |
                             | | | |           | | | | | |
                            _|_| | |           | | | | | |
                          _|  _ _|_|           | | | | | |
                  _ _ _ _|  _| |               | | | | | |
   7      8      |_ _ _ _| |_ _|               | | | | | |
   8     15      |_ _ _ _ _|              _ _ _| | | | | |
   9     13      |_ _ _ _ _|             |  _ _ _|_| | | |
                                        _| |    _ _ _|_| |
                                      _|  _|   |  _ _ _ _|
                                  _ _|  _|  _ _| |
                                 |  _ _|  _|    _|
                                 | |     |     |
                  _ _ _ _ _ _ _ _| |  _ _|  _ _|
  16     31      |_ _ _ _ _ _ _ _ _| |  _ _|
  17     18      |_ _ _ _ _ _ _ _ _| | |
  18     39      |_ _ _ _ _ _ _ _ _ _| |
  19     20      |_ _ _ _ _ _ _ _ _ _| |
  20     42      |_ _ _ _ _ _ _ _ _ _ _|
.
For the first nine terms of the sequence we can see in the above diagram that both Dyck path (the smallest and the largest) of the symmetric representation of sigma(k) have a central peak.
Compare with A317304.
		

Crossrefs

Column 1 gives A130883, n >= 1.
Column 2 gives A033816, n >= 1.
Row sums give the odd-indexed terms of A006002.
Right border gives the positive terms of A014107, also the odd-indexed terms of A000096.
The union of A000217, A317304 and this sequence gives A001477.
Some other sequences related to the central peak or the central valley of the symmetric representation of sigma are A000217, A000384, A007606, A007607, A014105, A014132, A162917, A161983, A317304. See also A317306.

A156140 Accumulation of Stern's diatomic series: a(0)=-1, a(1)=0, and a(n+1) = (2e(n)+1)*a(n) - a(n-1) for n > 1, where e(n) is the highest power of 2 dividing n.

Original entry on oeis.org

-1, 0, 1, 3, 2, 7, 5, 8, 3, 13, 10, 17, 7, 18, 11, 15, 4, 21, 17, 30, 13, 35, 22, 31, 9, 32, 23, 37, 14, 33, 19, 24, 5, 31, 26, 47, 21, 58, 37, 53, 16, 59, 43, 70, 27, 65, 38, 49, 11, 50, 39, 67, 28, 73, 45, 62, 17, 57, 40, 63, 23, 52, 29, 35, 6, 43, 37, 68, 31, 87, 56, 81, 25, 94, 69
Offset: 0

Views

Author

Arie Werksma (Werksma(AT)Tiscali.nl), Feb 04 2009

Keywords

Crossrefs

From Yosu Yurramendi, Mar 09 2018: (Start)
a(2^m + 0) = A000027(m), m >= 0.
a(2^m + 1) = A002061(m+2), m >= 1.
a(2^m + 2) = A002522(m), m >= 2.
a(2^m + 3) = A033816(m-1), m >= 2.
a(2^m + 4) = A002061(m), m >= 2.
a(2^m + 5) = A141631(m), m >= 3.
a(2^m + 6) = A084849(m-1), m >= 3.
a(2^m + 7) = A056108(m-1), m >= 3.
a(2^m + 8) = A000290(m-1), m >= 3.
a(2^m + 9) = A185950(m-1), m >= 4.
a(2^m + 10) = A144390(m-1), m >= 4.
a(2^m + 12) = A014106(m-2), m >= 4.
a(2^m + 16) = A028387(m-3), m >= 4.
a(2^m + 18) = A250657(m-4), m >= 5.
a(2^m + 20) = A140677(m-3), m >= 5.
a(2^m + 32) = A028872(m-2), m >= 5.
a(2^m - 1) = A005563(m-1), m >= 0.
a(2^m - 2) = A028387(m-2), m >= 2.
a(2^m - 3) = A033537(m-2), m >= 2.
a(2^m - 4) = A008865(m-1), m >= 3.
a(2^m - 7) = A140678(m-3), m >= 3.
a(2^m - 8) = A014209(m-3), m >= 4.
a(2^m - 16) = A028875(m-2), m >= 5.
a(2^m - 32) = A108195(m-5), m >= 6.
(End)

Programs

  • Maple
    A156140 := proc(n)
        option remember ;
        if n <= 1 then
            n-1 ;
        else
            (2*A007814(n-1)+1)*procname(n-1)-procname(n-2) ;
        end if;
    end proc:
    seq(A156140(n),n=0..80) ; # R. J. Mathar, Mar 14 2009
  • Mathematica
    Fold[Append[#1, (2 IntegerExponent[#2, 2] + 1) #1[[-1]] - #1[[-2]] ] &, {-1, 0}, Range[73]] (* Michael De Vlieger, Mar 09 2018 *)
  • PARI
    first(n)=my(v=vector(n+1)); v[1]=-1; v[2]=0; for(k=1,n-1,v[k+2]=(2*valuation(k,2)+1)*v[k+1] - v[k]); v \\ Charles R Greathouse IV, Apr 05 2016
    
  • PARI
    fusc(n)=my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); b
    a(n)=my(m=1,s,t); if(n==0, return(-1)); while(n%2==0, s+=fusc(n>>=1)); while(n>1, t=logint(n,2); n-=2^t; s+=m*fusc(n)*(t^2+t+1); m*=-t); m*(n-1) + s \\ Charles R Greathouse IV, Dec 13 2016
    
  • R
    a <- c(0,1)
    maxlevel <- 6 # by choice
    for(m in 1:maxlevel) {
      a[2^(m+1)] <- m + 1
      for(k in 1:(2^m-1)) {
        r <- m - floor(log2(k)) - 1
        a[2^r*(2*k+1)] <- a[2^r*(2*k)] + a[2^r*(2*k+2)]
    }}
    a
    # Yosu Yurramendi, May 08 2018

Formula

Let b(n) = A002487(n), Stern's diatomic series.
a(n+1)*b(n) - a(n)*b(n+1) = 1 for n >= 0.
a(2n+1) = a(n) + a(n+1) + b(n) + b(n+1) for n >= 0.
a(2n) = a(n) + b(n) for n >= 0.
a(2^n + k) = -n*a(k) + (n^2 + n + 1)*b(k) for 0 <= k <= 2^n.
b(2^n + k) = -a(k) + (n + 1)*b(k) for 0 <= k <= 2^n.
a(2^m + k) = b(2^m+k)*m + b(k), m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Mar 09 2018
a(2^(m+1)+2^m+1) = 2*m+1, m >= 0. - Yosu Yurramendi, Mar 09 2018
From Yosu Yurramendi, May 08 2018: (Start)
a(2^m) = m, m >= 0.
a(2^r*(2*k+1)) = a(2^r*(2*k)) + a(2^r*(2*k+2)), r = m - floor(log_2(k)) - 1, m > 0, 1 <= k < 2^m.
(End)

A185870 (Even,odd)-polka dot array in the natural number array A000027, by antidiagonals.

Original entry on oeis.org

3, 8, 10, 17, 19, 21, 30, 32, 34, 36, 47, 49, 51, 53, 55, 68, 70, 72, 74, 76, 78, 93, 95, 97, 99, 101, 103, 105, 122, 124, 126, 128, 130, 132, 134, 136, 155, 157, 159, 161, 163, 165, 167, 169, 171, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 327, 329, 331, 333, 335, 337, 339, 341, 343, 345, 347, 349, 351, 380, 382, 384, 386, 388, 390, 392, 394, 396, 398, 400, 402, 404, 406
Offset: 1

Views

Author

Clark Kimberling, Feb 05 2011

Keywords

Comments

This is the third of four polka dot arrays in the array A000027. See A185868.
row 1: A033816
col 1: A014105
col 2: -A168244
antidiagonal sums: A061317
antidiagonal sums: 3*(octahedral numbers) = 3*A005900.

Examples

			Northwest corner:
  3....8....17...30...47
  10...19...32...49...70
  21...34...51...72...97
  36...53...74...99...128
		

Crossrefs

Cf. A000027 (as an array), A185868, A185869, A185871.

Programs

  • Mathematica
    f[n_,k_]:=2n+(2n+2k-3)(n+k-1);
    TableForm[Table[f[n,k],{n,1,10},{k,1,15}]]
    Table[f[n-k+1,k],{n,14},{k,n,1,-1}]//Flatten
  • Python
    from math import comb, isqrt
    def A185870(n):
        a = (m:=isqrt(k:=n<<1))+(k>m*(m+1))
        x = n-comb(a,2)
        y = a-x+1
        return y*((y+(c:=x<<1)<<1)-5)+x*(c-3)+3 # Chai Wah Wu, Jun 18 2025

Formula

T(n,k) = 2*n + (n+k-1)*(2*n+2*k-3), k>=1, n>=1.

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

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 08 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(3,1);
T(1,2), T(2,1);
. . .
T(1,n), T(2,n-1), T(3,n-2), ... T(n,1);
T(1,n-1), T(2,n-3), T(3,n-4),...T(n-1,1);
. . .
First row matches with the elements antidiagonal {T(1,n), ... T(n,1)},
second row matches with the elements antidiagonal {T(1,n-1), ... T(n-1,1)}.
Table contains:
row 1 is alternation of elements A130883 and A096376,
row 2 accommodates elements A033816 in even places,
row 3 accommodates elements A100037 in odd places,
row 5 accommodates elements A100038 in odd places;
column 1 is alternation of elements A084849 and A000384,
column 2 is alternation of elements A014106 and A014105,
column 3 is alternation of elements A014107 and A091823,
column 4 is alternation of elements A071355 and |A168244|,
column 5 accommodates elements A033537 in even places,
column 7 is alternation of elements A100040 and A130861,
column 9 accommodates elements A100041 in even places;
the main diagonal is A058331,
diagonal 1, located above the main diagonal is A001844,
diagonal 2, located above the main diagonal is A001105,
diagonal 3, located above the main diagonal is A046092,
diagonal 4, located above the main diagonal is A056220,
diagonal 5, located above the main diagonal is A142463,
diagonal 6, located above the main diagonal is A054000,
diagonal 7, located above the main diagonal is A090288,
diagonal 9, located above the main diagonal is A059993,
diagonal 10, located above the main diagonal is |A147973|,
diagonal 11, located above the main diagonal is A139570;
diagonal 1, located under the main diagonal is A051890,
diagonal 2, located under the main diagonal is A005893,
diagonal 3, located under the main diagonal is A097080,
diagonal 4, located under the main diagonal is A093328,
diagonal 5, located under the main diagonal is A137882.

Examples

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

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := (n+k)(n+k-1)/2 - (-1)^(n+k)(n+k-1) - 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)
    j=(t*t+3*t+4)/2-n
    result=(t+2)*(t+1)/2-(t+1)*(-1)**t-j+2

Formula

T(n,k) = (k+n)*(k+n-1)/2-(k+n-1)*(-1)^(k+n)-k+2.
As linear sequence
a(n) = A003057(n)*A002024(n)/2- A002024(n)*(-1)^A003056(n)-A004736(n)+2.
a(n) = (t+2)*(t+1)/2 - (t+1)*(-1)^t-j+2, where j=(t*t+3*t+4)/2-n and t=int((math.sqrt(8*n-7) - 1)/ 2).

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

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 14 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(1,2), T(2,1), T(3,1);
. . .
T(1,n), T(2,n-1), T(1,n-1), T(2,n-2), T(3,n-2), T(4,n-3)...T(n,1);
...
Descent by snake along two adjacent antidiagonals - step to the southwest, step to the north, step to the southwest, step to the south and so on. The length of each step is 1. Phase four steps is rotated 90 degrees counterclockwise and the mirror of the phase A211377.
Table contains the following:
row 1 is alternation of elements A130883 and A100037,
row 2 accommodates elements A033816 in even places;
column 1 is alternation of elements A000384 and A014106,
column 2 is alternation of elements A091823 and A071355,
column 4 accommodates elements A130861 in odd places;
main diagonal is alternation of elements A188135 and A033567,
diagonal 1, located above the main diagonal, accommodates elements A033585 in even places,
diagonal 2, located above the main diagonal, accommodates elements A139271 in odd places,
diagonal 3, located above the main diagonal, is alternation of elements A033566 and A194431.

Examples

			The start of the sequence as a table:
   1   4   2   9   7   8  16 ...
   5   3  10   8  19  17  32 ...
   6  13  11  22  20  35  33 ...
  14  12  23  21  36  34  53 ...
  15  26  24  39  37  56  54 ...
  27  25  40  38  57  55  78 ...
  28  43  41  60  58  81  79 ...
  ...
The start of the sequence as a triangle array read by rows:
   1
   4  5
   2  3  6
   9 10 13 14
   7  8 11 12 15
  18 19 22 23 26 27
  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
   4  5  2  3  6
   9 10 13 14  7  8 11 12 15
  18 19 22 23 26 27 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+6, 2*r*r-5*r+7, ..., 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)^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)^n - (-1)^(n+k)(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)**i-(t+2)*(-1)**t)/2

Formula

As a table:
T(n,k) = ((k+n)^2-4*k+3-(-1)^n-(k+n)*(-1)^(k+n))/2.
As a linear sequence:
a(n) = (A003057(n)^2-4*A004736(n)+3-(-1)^A002260(n)-A003057(n)*(-1)^A003056(n))/2;
a(n) = ((t+2)^2-4*j+3-(-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).

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).
Showing 1-10 of 20 results. Next