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 11 results. Next

A007606 Take 1, skip 2, take 3, etc.

Original entry on oeis.org

1, 4, 5, 6, 11, 12, 13, 14, 15, 22, 23, 24, 25, 26, 27, 28, 37, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 137, 138
Offset: 1

Views

Author

Keywords

Comments

List the natural numbers: 1, 2, 3, 4, 5, 6, 7, ... . Keep the first number (1), delete the next two numbers (2, 3), keep the next three numbers (4, 5, 6), delete the next four numbers (7, 8, 9, 10) and so on.
a(A000290(n)) = A000384(n). - Reinhard Zumkeller, Feb 12 2011
A057211(a(n)) = 1. - Reinhard Zumkeller, Dec 30 2011
Numbers k with the property that the smallest Dyck path of the symmetric representation of sigma(k) has a central valley. (Cf. A237593.) - Omar E. Pol, Aug 28 2018
Union of nonzero terms of A000384 and A317304. - Omar E. Pol, Aug 29 2018
The values of k such that, in a listing of all congruence classes of positive integers, the k-th congruence class contains k. Here the class r mod m (with r in {1,...,m}) precedes the class r' mod m' (with r' in {1,...,m'}) iff mA360418. - James Propp, Feb 10 2023

Examples

			From _Omar E. Pol_, Aug 29 2018: (Start)
Written as an irregular triangle in which the row lengths are the odd numbers the sequence begins:
    1;
    4,   5,   6;
   11,  12,  13,  14,  15;
   22,  23,  24,  25,  26,  27,  28;
   37,  38,  39,  40,  41,  42,  43,  44,  45;
   56,  57,  58,  59,  60,  61,  62 , 63,  64,  65,  66;
   79,  80,  81,  82 , 83,  84,  85,  86,  87,  88,  89,  90,  91;
  106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120;
...
Row sums give A005917.
Column 1 gives A084849.
Column 2 gives A096376, n >= 1.
Right border gives A000384, n >= 1.
(End)
		

References

  • C. Dumitrescu & V. Seleacu, editors, Some Notions and Questions in Number Theory, Vol. I, Erhus Publ., Glendale, 1994.
  • R. Honsberger, Mathematical Gems III, M.A.A., 1985, p. 177.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • F. Smarandache, Properties of Numbers, 1972.

Crossrefs

Programs

  • Haskell
    a007606 n = a007606_list !! (n-1)
    a007606_list = takeSkip 1 [1..] where
       takeSkip k xs = take k xs ++ takeSkip (k + 2) (drop (2*k + 1) xs)
    -- Reinhard Zumkeller, Feb 12 2011
  • Mathematica
    Flatten[ Table[i, {j, 1, 17, 2}, {i, j(j - 1)/2 + 1, j(j + 1)/2}]] (* Robert G. Wilson v, Mar 11 2004 *)
    Join[{1},Flatten[With[{nn=20},Range[#[[1]],Total[#]]&/@Take[Thread[ {Accumulate[ Range[nn]]+1,Range[nn]}],{2,-1,2}]]]] (* Harvey P. Dale, Jun 23 2013 *)
    With[{nn=20},Take[TakeList[Range[(nn(nn+1))/2],Range[nn]],{1,nn,2}]]//Flatten (* Harvey P. Dale, Feb 10 2023 *)
  • PARI
    for(n=1,66,m=sqrtint(n-1);print1(n+m*(m+1),","))
    

Formula

a(n) = n + m*(m+1) where m = floor(sqrt(n-1)). - Klaus Brockhaus, Mar 26 2004
a(n+1) = a(n) + if n=k^2 then 2*k+1 else 1; a(1) = 1. - Reinhard Zumkeller, May 13 2009

A100036 a(n) = smallest m such that A100035(m) = n.

Original entry on oeis.org

1, 2, 3, 5, 7, 12, 14, 23, 25, 38, 40, 57, 59, 80, 82, 107, 109, 138, 140, 173, 175, 212, 214, 255, 257, 302, 304, 353, 355, 408, 410, 467, 469, 530, 532, 597, 599, 668, 670, 743, 745, 822, 824, 905, 907, 992, 994, 1083, 1085, 1178, 1180, 1277, 1279, 1380
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 31 2004

Keywords

Comments

Smallest positions of occurrences of the natural numbers as subsequence in A100035;
A100035(a(n)) = n and A100035(m) <> n for m < a(n);
a(n) < A100037(n) < A100038(n) < A100039(n).

Examples

			First terms (10=A,11=B,12=C) of A100035(a(n)):
123.4.5....6.7........8.9............A.B................C.
1231435425165764736271879869584938291A9BA8B7A6B5A4B3A2B1CBD;
a(1) = A084849(1) = 1, A100035(1) = 1;
a(2) = A014107(1) = 2, A100035(2) = 2;
a(3) = A033537(1) = 3, A100035(3) = 3;
a(4) = A100040(1) = 5, A100035(5) = 4;
a(5) = A100041(1) = 7, A100035(7) = 5.
		

Formula

Conjecture: a(n) = partial sums of sequence [1,1,1,2,2,5,2,9,2,13,2,17,2,21,2,25,2,29,2,33,...2,n/2-7,2,...]. In other words, a(n) consists of the numbers 1,2,3 and the sequences A096376 and A096376+2 interspersed. - Ralf Stephan, May 15 2007

A317304 Numbers k with the property that both Dyck paths of the symmetric representation of sigma(k) have a central valley.

Original entry on oeis.org

4, 5, 11, 12, 13, 14, 22, 23, 24, 25, 26, 27, 37, 38, 39, 40, 41, 42, 43, 44, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149
Offset: 1

Views

Author

Omar E. Pol, Aug 27 2018

Keywords

Comments

Also triangle read by rows which gives the even-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 even number of peaks. - Omar E. Pol, Sep 13 2018

Examples

			Written as an irregular triangle in which the row lengths are the positive even numbers, the sequence begins:
    4,   5;
   11,  12,  13,  14;
   22,  23,  24,  25,  26,  27;
   37,  38,  39,  40,  41,  42,  43,  44;
   56,  57,  58,  59,  60,  61,  62,  63,  64,  65;
   79,  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90;
  106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119;
...
Illustration of initial terms:
-------------------------------------------------
   k  sigma(k)  Diagram of the symmetry of sigma
-------------------------------------------------
                       _ _           _ _ _ _
                      | | |         | | | | |
                     _| | |         | | | | |
                 _ _|  _|_|         | | | | |
   4      7     |_ _ _|             | | | | |
   5      6     |_ _ _|             | | | | |
                                 _ _|_| | | |
                               _|    _ _|_| |
                             _|     |  _ _ _|
                            |      _|_|
                 _ _ _ _ _ _|  _ _|
  11     12     |_ _ _ _ _ _| |  _|
  12     28     |_ _ _ _ _ _ _| |
  13     14     |_ _ _ _ _ _ _| |
  14     24     |_ _ _ _ _ _ _ _|
.
For the first six 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 valley.
Compare with A317303.
		

Crossrefs

Row sums give A084367. n >= 1.
Column 1 gives A084849, n >= 1.
Column 2 gives A096376, n >= 1.
Right border gives the nonzero terms of A014106.
The union of A000217, A317303 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, A317303. See also A317306.

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

Original entry on oeis.org

5, 12, 14, 23, 25, 27, 38, 40, 42, 44, 57, 59, 61, 63, 65, 80, 82, 84, 86, 88, 90, 107, 109, 111, 113, 115, 117, 119, 138, 140, 142, 144, 146, 148, 150, 152, 173, 175, 177, 179, 181, 183, 185, 187, 189, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 255, 257, 259, 261, 263, 265, 267, 269, 271, 273, 275, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 375, 377, 408, 410, 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, 432, 434
Offset: 1

Views

Author

Clark Kimberling, Feb 05 2011

Keywords

Comments

This is the fourth of four polka dot arrays in the natural number array A000027. See A185868.
row 1: A096376
col 1: A014106
col 2: A071355
diag (5,25,...): A080856
diag (12,40,...): A033586
antidiagonal sums: A048395 (sums of consecutive squares)

Examples

			Northwest corner:
  5....12...23...38...57
  14...25...40...59...82
  27...42...61...84...111
  44...63...86...113..144
		

Crossrefs

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

Programs

  • Mathematica
    f[n_,k_]:=2n+(n+k-1)(2n+2k-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 A185871(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)-3)+x*(c-1)+1 # Chai Wah Wu, Jun 18 2025

Formula

T(n,k) = 2*n + (n+k-1)*(2*n+2*k-1), 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).

A079340 Absolute value of determinant of n X n matrix whose entries are the integers from 1 to n^2 spiraling outward, ending in a corner.

Original entry on oeis.org

1, 5, 72, 1380, 31920, 861840, 26611200, 925404480, 35805369600, 1526139014400, 71066912716800, 3590219977344000, 195589552648089600, 11430978821982720000, 713448513897799680000, 47363888351558338560000
Offset: 1

Views

Author

Kit Vongmahadlek (kit119(AT)yahoo.com), Jan 03 2003

Keywords

Comments

If n == 0 or 1 (mod 4), the sign of the determinant will be independent of the orientation of the spiral. For n == 2 or 3 (mod 4), the sign will be reversed when the orientation is rotated by 1/4 or flipped on the horizontal or vertical axis. - Franklin T. Adams-Watters, Dec 31 2013
This distribution of the integers is sometimes known as Ulam's spiral, although that is sometimes reserved for when the primes are marked out in some way. - Franklin T. Adams-Watters, Dec 31 2013

Examples

			n=2, det=-5: {1 2 / 4 3 }.
n=3, det=72: {7 8 9 / 6 1 2 / 5 4 3 }.
n=4, det=-1380: { 7 8 9 10 / 6 1 2 11 /5 4 3 12 / 16 15 14 13 }.
n=5, det=31920: { 21 22 23 24 25 / 20 7 8 9 10 / 19 6 1 2 11 /18 5 4 3 12 / 17 16 15 14 13 }
		

Crossrefs

Programs

  • Mathematica
    M[0, 0] = 1;
    M[i_, j_] := If[i <= j,
      If[i + j >= 0, If[i != j, M[i + 1, j] + 1, M[i, j - 1] + 1],
       M[i, j + 1] + 1],
      If[i + j > 1, M[i, j - 1] + 1, M[i - 1, j] + 1]
      ]
    M[n_] := If[EvenQ[n],
      Table[M[i, j], {j, n/2, -n/2 + 1, -1}, {i, -n/2 + 1, n/2}],
      Table[M[i, j], {j, (n - 1)/2, -(n - 1)/2, -1}, {i, -(n - 1)/2, (n - 1)/2}]]
    a[n_]:=Det[M[n]] (* Christian Krattenthaler, Apr 19 2017 *)
  • Maxima
    A079340(n):=if n=1 then 1 else (2*n^2-3*n+3)*(2*n-2)!/(2*(n-1)!)$
    makelist(A079340(n),n,1,30); /* Martin Ettl, Nov 05 2012 */

Formula

a(n) = (2*n^2-3*n+3) (2n-2)!/(2 (n-1)!) = A096376(n-1)*A000407(n-2), n>1. - Conjectured by Dean Hickerson, Jan 30 2003. Proved in the article by Bhatnagar and Krattenthaler.
D-finite with recurrence (2*n^2-7*n+8)*a(n) -2*(2*n-3)*(2*n^2-3*n+3)*a(n-1)=0. - R. J. Mathar, May 03 2019

Extensions

Extended by Robert G. Wilson v, Jan 25 2003

A116735 Number of permutations of length n which avoid the patterns 231, 1234, 4312; or avoid the patterns 312, 1234, 1432, etc.

Original entry on oeis.org

1, 2, 5, 12, 23, 38, 57, 80, 107, 138, 173, 212, 255, 302, 353, 408, 467, 530, 597, 668, 743, 822, 905, 992, 1083, 1178, 1277, 1380, 1487, 1598, 1713, 1832, 1955, 2082, 2213, 2348, 2487, 2630, 2777, 2928, 3083, 3242, 3405, 3572, 3743, 3918, 4097, 4280, 4467
Offset: 1

Views

Author

Lara Pudwell, Feb 26 2006

Keywords

Comments

a(n) is the number of permutations pi of length n such that pi and pi^2 both avoid 132 and 3421. - Colin Defant, Jul 24 2019

Programs

Formula

G.f.: x*(1 - x + 2*x^2 + 2*x^3)/(1-x)^3.
For n >= 2, a(n) = 2*n^2 - 7*n + 8. - Franklin T. Adams-Watters, Sep 16 2006
a(n) = A096376(n-2), n > 1. - R. J. Mathar, Aug 10 2008
E.g.f.: -8 - 2*x + (8 - 5*x + 2*x^2)*exp(x). - G. C. Greubel, Aug 10 2019

A386479 a(0) = 0; thereafter a(n) = 2*n^2 - 3*n + 5.

Original entry on oeis.org

0, 4, 7, 14, 25, 40, 59, 82, 109, 140, 175, 214, 257, 304, 355, 410, 469, 532, 599, 670, 745, 824, 907, 994, 1085, 1180, 1279, 1382, 1489, 1600, 1715, 1834, 1957, 2084, 2215, 2350, 2489, 2632, 2779, 2930, 3085, 3244, 3407, 3574, 3745, 3920, 4099, 4282, 4469, 4660, 4855, 5054, 5257, 5464, 5675, 5890, 6109, 6332, 6559, 6790
Offset: 0

Views

Author

N. J. A. Sloane, Jul 25 2025

Keywords

Comments

For n>0, a(n) is the maximum number of regions the plane can be divided into by drawing two n-chains (both finite and infinite regions are counted). See A386478 for further information.
We do not at present have an explicit construction that will achieve a(n) for n > 5.

Crossrefs

A column of the array in A386478.
Essentially the same (up to offset, initial terms, and the addition of a small constant) as several other sequences, including A014105, A014107, A084849, A096376, A236257, ....

Programs

  • Mathematica
    LinearRecurrence[{3,-3,1},{5,4,7},60] (* or *) a[n_]:=2n^2-3n+5;Array[a,60,0] (* James C. McMahon, Jul 26 2025 *)

Formula

From Stefano Spezia, Jul 26 2025: (Start)
G.f.: -x*(4-5*x+5*x^2) / (x-1)^3.
E.g.f.: exp(x)*(5 - x + 2*x^2) - 5. (End)

Extensions

Changed a(0) so as to match changes to A386478. - N. J. A. Sloane, Jul 26 2025

A199855 Inverse permutation to A210521.

Original entry on oeis.org

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

Views

Author

Boris Putievskiy, Feb 04 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(2,1), T(2,2), T(1,2), T(1,3), T(3,1),
...
T(2,n-1), T(4,n-3), T(6,n-5), ..., T(n,1),
T(2,n), T(4,n-2), T(6,n-4), ..., T(n,2),
T(1,n), T(3,n-2), T(5,n-4), ..., T(n-1,2),
T(1,n+1), T(3,n-1), T(5,n-3), ..., T(n+1,1),
...
The order of the list elements of adjacent antidiagonals. Let m be a positive integer.
Movement by antidiagonal {T(1,2*m), T(2*m,1)} from T(2,2*m-1) to T(2*m,1) length of step is 2,
movement by antidiagonal {T(1,2*m+1), T(2*m+1,1)} from T(2,2*m) to T(2*m,2) length of step is 2,
movement by antidiagonal {T(1,2*m), T(2*m,1)} from T(1,2*m) to T(2*m-1,2) length of step is 2,
movement by antidiagonal {T(1,2*m+1), T(2*m+1,1)} from T(1,2*m+1) to T(2*m+1,1) length of step is 2.
Table contains:
row 1 is alternation of elements A001844 and A084849,
row 2 is alternation of elements A130883 and A058331,
row 3 is alternation of elements A051890 and A096376,
row 4 is alternation of elements A033816 and A005893,
row 6 is alternation of elements A100037 and A093328;
row 5 accommodates elements A097080 in odd places,
row 7 accommodates elements A137882 in odd places,
row 10 accommodates elements A100038 in odd places,
row 14 accommodates elements A100039 in odd places;
column 1 is A093005 and alternation of elements A000384 and A001105,
column 2 is alternation of elements A046092 and A014105,
column 3 is A105638 and alternation of elements A014106 and A056220,
column 4 is alternation of elements A142463 and A014107,
column 5 is alternation of elements A091823 and A054000,
column 6 is alternation of elements A090288 and |A168244|,
column 8 is alternation of elements A059993 and A033537;
column 7 accommodates elements A071355 in odd places,
column 9 accommodates elements |A147973| in even places,
column 10 accommodates elements A139570 in odd places,
column 13 accommodates elements A130861 in odd places.

Examples

			The start of the sequence as table:
   1,  4,  5,  11,  13,  22,  25,  37,  41,  56,  61, ...
   2,  3,  7,   9,  16,  19,  29,  33,  46,  51,  67, ...
   6, 12, 14,  23,  26,  38,  42,  57,  62,  80,  86, ...
   8, 10, 17,  20,  30,  34,  47,  52,  68,  74,  93, ...
  15, 24, 27,  39,  43,  58,  63,  81,  87, 108, 115, ...
  18, 21, 31,  35,  48,  53,  69,  75,  94, 101. 123, ...
  28, 40, 44,  59,  64,  82,  88, 109, 116, 140, 148, ...
  32, 36, 49,  54,  70,  76,  95, 102, 124, 132, 157, ...
  45, 60, 65,  83,  89, 110, 117, 141, 149, 176, 185, ...
  50, 55, 71,  77,  96, 103, 125, 133, 158, 167, 195, ...
  66, 84, 90, 111, 118, 142, 150, 177, 186, 216, 226, ...
  ...
The start of the sequence as triangle array read by rows:
   1;
   4,  2;
   5,  3,  6;
  11,  7, 12,  8;
  13,  9, 14, 10, 15;
  22, 16, 23, 17, 24, 18;
  25, 19, 26, 20, 27, 21, 28;
  37, 29, 38, 30, 39, 31, 40, 32;
  41, 33, 42, 34, 43, 35, 44, 36, 45;
  56, 46, 57, 47, 58, 48, 59, 49, 60, 50;
  61, 51, 62, 52, 63, 53, 64, 54, 65, 55, 66;
  ...
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, 2, 5, 3, 6;
  11, 7,12, 8,13, 9,14,10,15;
  22,16,23,17,24,18,25,19,26,20,27,21,28;
  37,29,38,30,39,31,40,32,41,33,42,34,43,35,44,36,45;
  56,46,57,47,58,48,59,49,60,50,61,51,62,52,63,53,64,54,65,55,66;
  ...
Row number r contains permutation numbers 4*r-3 from 2*r*r-5*r+4 to 2*r*r-r:
2*r*r-3*r+2,2*r*r-5*r+4, 2*r*r-3*r+3, 2*r*r-5*r+5, 2*r*r-3*r+4, 2*r*r-5*r+6, ..., 2*r*r-3*r+1, 2*r*r-r.
...
		

Crossrefs

Programs

  • 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*j**2+(4*i-5)*j+2*i**2-3*i+2+(2+(-1)**j)*((1-(t+1)*(-1)**i)))/4

Formula

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

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

Original entry on oeis.org

1, 5, 6, 4, 3, 2, 12, 13, 14, 15, 11, 10, 9, 8, 7, 23, 24, 25, 26, 27, 28, 22, 21, 20, 19, 18, 17, 16, 38, 39, 40, 41, 42, 43, 44, 45, 37, 36, 35, 34, 33, 32, 31, 30, 29, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 80
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(3,1), T(2,2), T(1,3);
T(1,2), T(2,1);
. . .
T(2*m+1,1), T(2*m,2), T(2*m-1,3),...T(2,2*m), T(1,2*m+1);
T(1,2*m), T(2,2*m-1), T(3,2*m-2),...T(2*m-1,2),T(2*m,1);
. . .
First row contains antidiagonal {T(1,2*m+1), ... T(2*m+1,1)}, read upwards.
Second row contains antidiagonal {T(1,2*m), ... T(2*m,1)}, read downwards.

Examples

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

Crossrefs

Programs

  • 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-(3*i+j-2)*(-1)**t)/2

Formula

As table
T(n,k) = ((n+k)^2-2*(n+k)+4-(3*n+k-2)*(-1)^(n+k))/2.
As linear sequence
a(n) = (A003057(n)^2-2*A003057(n)+4-(3*A002260(n)+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).
Showing 1-10 of 11 results. Next