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-8 of 8 results.

A034856 a(n) = binomial(n+1, 2) + n - 1 = n*(n+3)/2 - 1.

Original entry on oeis.org

1, 4, 8, 13, 19, 26, 34, 43, 53, 64, 76, 89, 103, 118, 134, 151, 169, 188, 208, 229, 251, 274, 298, 323, 349, 376, 404, 433, 463, 494, 526, 559, 593, 628, 664, 701, 739, 778, 818, 859, 901, 944, 988, 1033, 1079, 1126, 1174, 1223, 1273, 1324, 1376, 1429, 1483
Offset: 1

Views

Author

Keywords

Comments

Number of 1's in the n X n lower Hessenberg (0,1)-matrix (i.e., the matrix having 1's on or below the superdiagonal and 0's above the superdiagonal).
If a 2-set Y and 2-set Z, having one element in common, are subsets of an n-set X then a(n-2) is the number of 3-subsets of X intersecting both Y and Z. - Milan Janjic, Oct 03 2007
Number of binary operations which have to be added to Moisil's algebras to obtain algebraic counterparts of n-valued Łukasiewicz logics. See the Wójcicki and Malinowski book, page 31. - Artur Jasinski, Feb 25 2010
Also (n + 1)!(-1)^(n + 1) times the determinant of the n X n matrix given by m(i,j) = i/(i+1) if i=j and otherwise 1. For example, (5+1)! * ((-1)^(5+1)) * Det[{{1/2, 1, 1, 1, 1}, {1, 2/3, 1, 1, 1}, {1, 1, 3/4, 1, 1}, {1, 1, 1, 4/5, 1}, {1, 1, 1, 1, 5/6}}] = 19 = a(5), and (6+1)! * ((-1)^(6+1)) * Det[{{1/2, 1, 1, 1, 1, 1}, {1, 2/3, 1, 1, 1, 1}, {1, 1, 3/4, 1, 1, 1}, {1, 1, 1, 4/5, 1, 1}, {1, 1, 1, 1, 5/6, 1}, {1, 1, 1, 1, 1, 6/7}}] = 26 = a(6). - John M. Campbell, May 20 2011
2*a(n-1) = n*(n+1) - 4, n>=0, with a(-1) = -2 and a(0) = -1, gives the values for a*c of indefinite binary quadratic forms [a, b, c] of discriminant D = 17 for b = 2*n + 1. In general D = b^2 - 4*a*c > 0 and the form [a, b, c] is a*x^2 + b*x*y + c*y^2. - Wolfdieter Lang, Aug 15 2013
a(n) is not divisible by 3, 5, 7, or 11. - Vladimir Shevelev, Feb 03 2014
With a(0) = 1 and a(1) = 2, a(n-1) is the number of distinct values of 1 +- 2 +- 3 +- ... +- n, for n > 0. - Derek Orr, Mar 11 2015
Also, numbers m such that 8*m+17 is a square. - Bruno Berselli, Sep 16 2015
Omar E. Pol's formula from Apr 23 2008 can be interpreted as the position of an element located on the third diagonal of an triangular array (read by rows) provided n > 1. - Enrique Pérez Herrero, Aug 29 2016
a(n) is the sum of the numerator and denominator of the fraction that is the sum of 2/(n-1) + 2/n; all fractions are reduced and n > 2. - J. M. Bergot, Jun 14 2017
a(n) is also the number of maximal irredundant sets in the (n+2)-path complement graph for n > 1. - Eric W. Weisstein, Apr 12 2018
From Klaus Purath, Dec 07 2020: (Start)
a(n) is not divisible by primes listed in A038890. The prime factors are given in A038889 and the prime terms of the sequence are listed in A124199.
Each odd prime factor p divides exactly 2 out of any p consecutive terms with the exception of 17, which appears only once in such an interval of terms. If a(i) and a(k) form such a pair that are divisible by p, then i + k == -3 (mod p), see examples.
If A is a sequence satisfying the recurrence t(n) = 5*t(n-1) - 2*t(n-2) with the initial values either A(0) = 1, A(1) = n + 4 or A(0) = -1, A(1) = n-1, then a(n) = (A(i)^2 - A(i-1)*A(i+1))/2^i for i>0. (End)
Mark each point on a 4^n grid with the number of points that are visible from the point; for n > 1, a(n) is the number of distinct values in the grid. - Torlach Rush, Mar 23 2021
The sequence gives the number of "ON" cells in the cellular automaton on a quadrant of a square grid after the n-th stage, where the "ON" cells lie only on the external perimeter and the perimeter of inscribed squares having the cell (1,1) as a unique common vertex. See Spezia link. - Stefano Spezia, May 28 2025

Examples

			From _Bruno Berselli_, Mar 09 2015: (Start)
By the definition (first formula):
----------------------------------------------------------------------
  1       4         8           13            19              26
----------------------------------------------------------------------
                                                              X
                                              X              X X
                                X            X X            X X X
                    X          X X          X X X          X X X X
          X        X X        X X X        X X X X        X X X X X
  X      X X      X X X      X X X X      X X X X X      X X X X X X
          X        X X        X X X        X X X X        X X X X X
----------------------------------------------------------------------
(End)
From _Klaus Purath_, Dec 07 2020: (Start)
Assuming a(i) is divisible by p with 0 < i < p and a(k) is the next term divisible by p, then from i + k == -3 (mod p) follows that k = min(p*m - i - 3) != i for any integer m.
(1) 17|a(7) => k = min(17*m - 10) != 7 => m = 2, k = 24 == 7 (mod 17). Thus every a(17*m + 7) is divisible by 17.
(2) a(9) = 53 => k = min(53*m - 12) != 9 => m = 1, k = 41. Thus every a(53*m + 9) and a(53*m + 41) is divisible by 53.
(3) 101|a(273) => 229 == 71 (mod 101) => k = min(101*m - 74) != 71 => m = 1, k = 27. Thus every a(101*m + 27) and a(101*m + 71) is divisible by 101. (End)
From _Omar E. Pol_, Aug 08 2021: (Start)
Illustration of initial terms:                             _ _
.                                           _ _           |_|_|_
.                              _ _         |_|_|_         |_|_|_|_
.                   _ _       |_|_|_       |_|_|_|_       |_|_|_|_|_
.          _ _     |_|_|_     |_|_|_|_     |_|_|_|_|_     |_|_|_|_|_|_
.   _     |_|_|    |_|_|_|    |_|_|_|_|    |_|_|_|_|_|    |_|_|_|_|_|_|
.  |_|    |_|_|    |_|_|_|    |_|_|_|_|    |_|_|_|_|_|    |_|_|_|_|_|_|
.
.   1       4         8          13            19              26
------------------------------------------------------------------------ (End)
		

References

  • A. S. Karpenko, Łukasiewicz's Logics and Prime Numbers, 2006 (English translation).
  • G. C. Moisil, Essais sur les logiques non-chrysippiennes, Ed. Academiei, Bucharest, 1972.
  • Wójcicki and Malinowski, eds., Łukasiewicz Sentential Calculi, Wrocław: Ossolineum, 1977.

Crossrefs

Subsequence of A165157.
Triangular numbers (A000217) minus two.
Third diagonal of triangle in A059317.

Programs

  • Haskell
    a034856 = subtract 1 . a000096 -- Reinhard Zumkeller, Feb 20 2015
    
  • Magma
    [Binomial(n + 1, 2) + n - 1: n in [1..60]]; // Vincenzo Librandi, May 21 2011
    
  • Maple
    a := n -> hypergeom([-2, n-1], [1], -1);
    seq(simplify(a(n)), n=1..53); # Peter Luschny, Aug 02 2014
  • Mathematica
    f[n_] := n (n + 3)/2 - 1; Array[f, 55] (* or *) k = 2; NestList[(k++; # + k) &, 1, 55] (* Robert G. Wilson v, Jun 11 2010 *)
    Table[Binomial[n + 1, 2] + n - 1, {n, 53}] (* or *)
    Rest@ CoefficientList[Series[x (1 + x - x^2)/(1 - x)^3, {x, 0, 53}], x] (* Michael De Vlieger, Aug 29 2016 *)
  • Maxima
    A034856(n) := block(
            n-1+(n+1)*n/2
    )$ /* R. J. Mathar, Mar 19 2012 */
    
  • PARI
    A034856(n)=(n+3)*n\2-1 \\ M. F. Hasler, Jan 21 2015
    
  • Python
    def A034856(n): return n*(n+3)//2 -1 # G. C. Greubel, Jun 15 2025

Formula

G.f.: A(x) = x*(1 + x - x^2)/(1 - x)^3.
a(n) = A049600(3, n-2).
a(n) = binomial(n+2, 2) - 2. - Paul Barry, Feb 27 2003
With offset 5, this is binomial(n, 0) - 2*binomial(n, 1) + binomial(n, 2), the binomial transform of (1, -2, 1, 0, 0, 0, ...). - Paul Barry, Jul 01 2003
Row sums of triangle A131818. - Gary W. Adamson, Jul 27 2007
Binomial transform of (1, 3, 1, 0, 0, 0, ...). Also equals A130296 * [1,2,3,...]. - Gary W. Adamson, Jul 27 2007
Row sums of triangle A134225. - Gary W. Adamson, Oct 14 2007
a(n) = A000217(n+1) - 2. - Omar E. Pol, Apr 23 2008
From Jaroslav Krizek, Sep 05 2009: (Start)
a(n) = a(n-1) + n + 1 for n >= 1.
a(n) = n*(n-1)/2 + 2*n - 1.
a(n) = A000217(n-1) + A005408(n-1) = A005843(n-1) + A000124(n-1). (End)
a(n) = Hyper2F1([-2, n-1], [1], -1). - Peter Luschny, Aug 02 2014
a(n) = floor[1/(-1 + Sum_{m >= n+1} 1/S2(m,n+1))], where S2 is A008277. - Richard R. Forberg, Jan 17 2015
a(n) = A101881(2*(n-1)). - Reinhard Zumkeller, Feb 20 2015
a(n) = A253909(n+3) - A000217(n+3). - David Neil McGrath, May 23 2015
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>3. - David Neil McGrath, May 23 2015
For n > 1, a(n) = 4*binomial(n-1,1) + binomial(n-2,2), comprising the third column of A267633. - Tom Copeland, Jan 25 2016
From Klaus Purath, Dec 07 2020: (Start)
a(n) = A024206(n) + A024206(n+1).
a(2*n-1) = -A168244(n+1).
a(2*n) = A091823(n). (End)
Sum_{n>=1} 1/a(n) = 3/2 + 2*Pi*tan(sqrt(17)*Pi/2)/sqrt(17). - Amiram Eldar, Jan 06 2021
a(n) + a(n+1) = A028347(n+2). - R. J. Mathar, Mar 13 2021
a(n) = A000290(n) - A161680(n-1). - Omar E. Pol, Mar 26 2021
E.g.f.: 1 + exp(x)*(x^2 + 4*x - 2)/2. - Stefano Spezia, Jun 05 2021
a(n) = A024916(n) - A244049(n). - Omar E. Pol, Aug 01 2021
a(n) = A000290(n) - A000217(n-2). - Omar E. Pol, Aug 05 2021

Extensions

More terms from Zerinvary Lajos, May 12 2006

A250656 T(n,k)=Number of (n+1)X(k+1) 0..1 arrays with nondecreasing x(i,j)-x(i,j-1) in the i direction and nondecreasing min(x(i,j),x(i-1,j)) in the j direction.

Original entry on oeis.org

9, 16, 19, 25, 34, 39, 36, 53, 70, 79, 49, 76, 109, 142, 159, 64, 103, 156, 221, 286, 319, 81, 134, 211, 316, 445, 574, 639, 100, 169, 274, 427, 636, 893, 1150, 1279, 121, 208, 345, 554, 859, 1276, 1789, 2302, 2559, 144, 251, 424, 697, 1114, 1723, 2556, 3581
Offset: 1

Views

Author

R. H. Hardin, Nov 26 2014

Keywords

Comments

Table starts
....9...16....25....36....49....64....81...100...121...144...169....196....225
...19...34....53....76...103...134...169...208...251...298...349....404....463
...39...70...109...156...211...274...345...424...511...606...709....820....939
...79..142...221...316...427...554...697...856..1031..1222..1429...1652...1891
..159..286...445...636...859..1114..1401..1720..2071..2454..2869...3316...3795
..319..574...893..1276..1723..2234..2809..3448..4151..4918..5749...6644...7603
..639.1150..1789..2556..3451..4474..5625..6904..8311..9846.11509..13300..15219
.1279.2302..3581..5116..6907..8954.11257.13816.16631.19702.23029..26612..30451
.2559.4606..7165.10236.13819.17914.22521.27640.33271.39414.46069..53236..60915
.5119.9214.14333.20476.27643.35834.45049.55288.66551.78838.92149.106484.121843

Examples

			Some solutions for n=4 k=4
..1..1..0..1..1....0..0..0..0..0....0..0..0..0..0....1..1..1..0..0
..0..0..0..1..1....1..1..1..1..1....1..1..1..1..1....0..0..0..0..0
..0..0..0..1..1....1..1..1..1..1....0..0..0..0..0....0..0..0..0..0
..0..0..0..1..1....0..0..0..0..0....1..1..1..1..1....1..1..1..1..1
..0..0..0..1..1....0..1..1..1..1....1..1..1..1..1....0..0..0..1..1
		

Crossrefs

Column 1 is A052549(n+1)
Column 2 is A176449
Column 3 is A156127(n+1)
Column 4 is A048487(n+2)
Row 1 is A000290(n+2)
Row 2 is A168244(n+3)

Formula

Empirical: T(n,k) = 2^(n-1)*k^2 + (5*2^(n-1)-1)*k + 2^(n+1)
Empirical for column k:
k=1: a(n) = 3*a(n-1) -2*a(n-2); also a(n) = 2^(n-1) +(5*2^(n-1) -1) +2^(n+1)
k=2: a(n) = 3*a(n-1) -2*a(n-2); also a(n) = 2^(n-1)*4 +(5*2^(n-1) -1)*2 +2^(n+1)
k=3: a(n) = 3*a(n-1) -2*a(n-2); also a(n) = 2^(n-1)*9 +(5*2^(n-1) -1)*3 +2^(n+1)
k=4: a(n) = 3*a(n-1) -2*a(n-2); also a(n) = 2^(n-1)*16 +(5*2^(n-1) -1)*4 +2^(n+1)
k=5: a(n) = 3*a(n-1) -2*a(n-2); also a(n) = 2^(n-1)*25 +(5*2^(n-1) -1)*5 +2^(n+1)
k=6: a(n) = 3*a(n-1) -2*a(n-2); also a(n) = 2^(n-1)*36 +(5*2^(n-1) -1)*6 +2^(n+1)
k=7: a(n) = 3*a(n-1) -2*a(n-2); also a(n) = 2^(n-1)*49 +(5*2^(n-1) -1)*7 +2^(n+1)
Empirical for row n:
n=1: a(n) = 1*n^2 + 4*n + 4
n=2: a(n) = 2*n^2 + 9*n + 8
n=3: a(n) = 4*n^2 + 19*n + 16
n=4: a(n) = 8*n^2 + 39*n + 32
n=5: a(n) = 16*n^2 + 79*n + 64
n=6: a(n) = 32*n^2 + 159*n + 128
n=7: a(n) = 64*n^2 + 319*n + 256

A168235 1+5*n+7*n^2.

Original entry on oeis.org

13, 39, 79, 133, 201, 283, 379, 489, 613, 751, 903, 1069, 1249, 1443, 1651, 1873, 2109, 2359, 2623, 2901, 3193, 3499, 3819, 4153, 4501, 4863, 5239, 5629, 6033, 6451, 6883, 7329, 7789, 8263, 8751, 9253, 9769, 10299, 10843, 11401, 11973, 12559, 13159, 13773
Offset: 1

Views

Author

A.K. Devaraj, Nov 21 2009

Keywords

Comments

Consider the quadratic cyclotomic polynomial f(x) = x^2+x+1 and the quotients defined by f(x + n*f(x))/f(x). a(n) is the quotient at x=2.
See A168240 for x=3 or A168244 for x= 1+sqrt(-5).

Examples

			When x = 2, f(x) = 7. Hence at n=1, f( x + f(x))/f(x) = 13 = a(1).
		

Crossrefs

Programs

Formula

a(1)=13, a(2)=39, a(3)=79, a(n)=3*a(n-1)-3*a(n-2)+a(n-3). - Harvey P. Dale, Feb 07 2015
From G. C. Greubel, Apr 09 2016: (Start)
G.f.: (1 + 10*x + 3*x^2)/(1-x)^3.
E.g.f.: (1 + 12*x + 7*x^2)*exp(x). (End)

Extensions

Edited, definition simplified, sequence extended beyond a(8) by R. J. Mathar, Nov 23 2009

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).

A163832 a(n) = n*(2*n^2 + 5*n + 1).

Original entry on oeis.org

0, 8, 38, 102, 212, 380, 618, 938, 1352, 1872, 2510, 3278, 4188, 5252, 6482, 7890, 9488, 11288, 13302, 15542, 18020, 20748, 23738, 27002, 30552, 34400, 38558, 43038, 47852, 53012, 58530, 64418, 70688, 77352, 84422, 91910, 99828, 108188, 117002
Offset: 0

Views

Author

Vincenzo Librandi, Aug 05 2009

Keywords

Comments

Row sums of triangle A155156.

Crossrefs

Cf. A155156.

Programs

  • Mathematica
    Table[n(2n^2+5n+1),{n,0,40}] (* or *) LinearRecurrence[{4,-6,4,-1},{0,8,38,102},40] (* Harvey P. Dale, Feb 02 2012 *)
  • PARI
    for(n=0, 40, print1(n*(2*n^2+5*n+1)", ")); \\ Vincenzo Librandi, Feb 22 2012

Formula

G.f.: -2*x*(1+x)*(x-4)/(x-1)^4.
a(n) = 4*a(n-1) -6*a(n-2) +4*a(n-3) -a(n-4).
a(n) = A163683(n) + n = A163815(n) - 2*n = 2*A162254(n).
a(n) = -n*A168244(n+2). - Bruno Berselli, Feb 02 2012
E.g.f.: x*(8 + 11*x + 2*x^2)*exp(x). - G. C. Greubel, Aug 05 2017

Extensions

Edited by R. J. Mathar, Aug 05 2009

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-8 of 8 results.