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

A129952 Binomial transform of A124625.

Original entry on oeis.org

1, 1, 2, 6, 16, 40, 96, 224, 512, 1152, 2560, 5632, 12288, 26624, 57344, 122880, 262144, 557056, 1179648, 2490368, 5242880, 11010048, 23068672, 48234496, 100663296, 209715200, 436207616, 905969664, 1879048192, 3892314112
Offset: 0

Views

Author

Paul Curtz, Jun 10 2007

Keywords

Comments

Essentially the same as A057711: a(n) = A057711(n) for n >= 1.
Number of permutations of length n>=0 avoiding the partially ordered pattern (POP) {1>2, 1>3} of length 4. That is, number of length n permutations having no subsequences of length 4 in which the first element is larger than the second and third elements. - Sergey Kitaev, Dec 08 2020

Crossrefs

Cf. A124625, A045623, A057711, A129953 (first differences), A129954 (second differences), A129955 (third differences).

Programs

  • Magma
    m:=15; S:=&cat[ [ 1, 2*i ]: i in [0..m] ]; [ &+[ Binomial(j-1, k-1)*S[k]: k in [1..j] ]: j in [1..2*m] ]; // Klaus Brockhaus, Jun 17 2007
    
  • Mathematica
    LinearRecurrence[{4, -4}, {1, 1, 2, 6}, 30] (* G. C. Greubel, Jun 08 2016; corrected by Georg Fischer, Apr 02 2019 *)
  • PARI
    {m=29; print1(1, ",", 1, ","); for(n=2, m, print1(n*2^(n-2), ","))} \\ Klaus Brockhaus, Jun 17 2007
    
  • Python
    def A129952(n): return n<1 else 1 # Chai Wah Wu, Oct 03 2024

Formula

a(0) = 1, a(1) = 1; for n > 1, a(n) = n*2^(n-2).
G.f.: (1-3*x+2*x^2+2*x^3)/(1-2*x)^2.
E.g.f.: (1/2)*(x*exp(2*x) + x + 2). - G. C. Greubel, Jun 08 2016

Extensions

Edited and extended by Klaus Brockhaus, Jun 17 2007

A203192 (n-1)-st elementary symmetric function of the first n terms of (1,2,1,4,1,6,1,8,...)=(A124625 for n>1).

Original entry on oeis.org

1, 3, 5, 22, 30, 188, 236, 1936, 2320, 23584, 27424, 332928, 379008, 5352192, 5997312, 96602112, 106924032, 1934954496, 2120749056, 42600775680, 46316666880, 1022682562560, 1104432168960, 26588121661440, 28550112215040
Offset: 1

Views

Author

Clark Kimberling, Dec 30 2011

Keywords

Crossrefs

Cf. A124625.

Programs

  • Mathematica
    f[k_] := If[Mod[k, 2] == 1, 1, k];
    t[n_] := Table[f[k], {k, 1, n}]
    a[n_] := SymmetricPolynomial[n - 1, t[n]]
    Table[a[n], {n, 1, 33}] (* A203192 *)

A133934 A007318 * (a diagonalized version of A124625).

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 1, 6, 3, 4, 1, 8, 6, 16, 1, 1, 10, 10, 40, 5, 6, 1, 12, 15, 80, 15, 36, 1, 1, 14, 21, 140, 35, 126, 7, 8, 1, 16, 28, 224, 70, 336, 28, 64, 1, 1, 18, 36, 336, 126, 756, 84, 288, 9, 10
Offset: 1

Views

Author

Gary W. Adamson, Sep 29 2007

Keywords

Comments

Row sums = A129954: (1, 3, 6, 14, 32, 72, 160, ...).

Examples

			First few rows of the triangle:
  1;
  1,  2;
  1,  4,  1;
  1,  6,  3,  4;
  1,  8,  6, 16,  1;
  1, 10, 10, 40,  5,  6;
  1, 12, 15, 80, 15, 36,  1;
  ...
		

Crossrefs

Cf. A129954.

Formula

Binomial transform of an infinite lower triangular matrix, with (1, 2, 1, 4, 1, 6, ...) in the main diagonal and zeros elsewhere.

A093178 If n is even then 1, otherwise n.

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 1, 7, 1, 9, 1, 11, 1, 13, 1, 15, 1, 17, 1, 19, 1, 21, 1, 23, 1, 25, 1, 27, 1, 29, 1, 31, 1, 33, 1, 35, 1, 37, 1, 39, 1, 41, 1, 43, 1, 45, 1, 47, 1, 49, 1, 51, 1, 53, 1, 55, 1, 57, 1, 59, 1, 61, 1, 63, 1, 65, 1, 67, 1, 69, 1, 71, 1, 73, 1, 75, 1, 77, 1, 79, 1, 81, 1, 83, 1, 85
Offset: 0

Views

Author

Michael Somos, Mar 27 2004

Keywords

Comments

Continued fraction expansion for tan(1).
1 followed by run lengths of A062557 = 2n-1 1's followed by a 2. - Jeremy Gardiner, Aug 12 2012
Greatest common divisor of n and (n+1) mod 2. - Bruno Berselli, Mar 07 2017

Examples

			1.557407724654902230506974807... = 1 + 1/(1 + 1/(1 + 1/(3 + 1/(1 + ...))))
G.f. = 1 + x + x^2 + 3*x^3 + x^4 + 5*x^5 + x^6 + 7*x^7 + x^8 + 9*x^9 + x^10 + ...
		

Crossrefs

Equals |A009001(n)|.
Cf. A133080, A049471 (decimal expansion), A009001, A161738, A062557, A124625.

Programs

  • Maple
    A093178:=n->(n+1+(1-n)*(-1)^n)/2; seq(A093178(k), k=0..100); # Wesley Ivan Hurt, Oct 19 2013
  • Mathematica
    Join[{1},Riffle[Range[1,85,2],1]] (* or *) Array[If[EvenQ[#],1,#]&,87,0] (* Harvey P. Dale, Nov 23 2011 *)
  • PARI
    {a(n) = if( n%2, n, 1)};

Formula

G.f.: (1+x-x^2+x^3)/(1-x^2)^2.
a(n) = (-1)^n * a(-n) for all n in Z.
a(n) = (1/2) * [ 1 + n + (1-n)*(-1)^n ]. - Ralf Stephan, Dec 02 2004
a(n) = n^n mod (n+1) for n > 0. - Amarnath Murthy, Apr 18 2004
Satisfies a(0) = 1, a(n+1) = a(n) + n if a(n) < n else a(n+1) = a(n)/n. - Amarnath Murthy, Oct 29 2002
a(n) = ((n+1)+(1-n)(-1)^n)/2 and have e.g.f. (1+x)cosh(x). - Paul Barry, Apr 09 2003
a(n) = binomial(n, 2*floor(n/2)). - Paul Barry, Dec 28 2006
Starting (1, 1, 3, 1, 5, 1, 7, ...) = A133080^(-1) * [1,2,3,...]. - Gary W. Adamson, Sep 08 2007
a(n) = denom(b(n+2)/b(n+1)) with b(n) = product((2*n-3-2*k), k=0..floor(n/2-1)). - Johannes W. Meijer, Jun 18 2009
a(n) = 2*floor(n/2) - n*(n-1 mod 2) + 1. - Wesley Ivan Hurt, Oct 19 2013
a(n) = n^(n mod 2). - Wesley Ivan Hurt, Apr 16 2014

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

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
Offset: 1

Views

Author

Boris Putievskiy, Jan 28 2013

Keywords

Comments

Row T(n,k) for odd n is even numbers sandwiched between n's starts from n and 2*n.
Row T(n,k) for even n is odd numbers sandwiched between n's starts from 2*n-1 and n.
Antidiagonal T(1,k), T(2,k-1), ..., T(k,1) for odd k is 1,2,3,...,k.
Antidiagonal T(1,k), T(2,k-1), ..., T(k,1) for even k is k+1, k+2, ..., 2*k+1.
The main diagonal is A000027.
Diagonal, located above the main diagonal T(1,k), T(2,k+1), T(3,k+2), ... for odd k is A000027.
Diagonal, located above the main diagonal T(1,k), T(2,k+1), T(3,k+2), ... for even k is k, k+3, k+6, ..., A016789, A016777, A008585.
Diagonal, located below the main diagonal T(n,1), T(n+1,2), T(n+2,3), ... for odd n is n,n+1, n+2, ... A000027.
Diagonal, located below the main diagonal T(n,1), T(n+1,2), T(n+2,3), ... for even n is 2*n-1, 2*n+2, 2*n+5, ... A008585, A016777, A016789.
The table contains:
A124625 as row 1,
A114753 as column 1,
A109043 as column 2,
A066104 as column 4.

Examples

			The start of the sequence as table:
   1   2   1   4   1   6   1   8   1  10
   3   2   5   2   7   2   9   2  11   2
   3   6   3   8   3  10   3  12   3  14
   7   4   9   4  11   4  13   4  15   4
   5  10   5  12   5  14   5  16   5  18
  11   6  13   6  15   6  17   6  19   6
   7  14   7  16   7  18   7  20   7  22
  15   8  17   8  19   8  21   8  23   8
   9  18   9  20   9  22   9  24   9  26
  19  10  21  10  23  10  25  10  27  10
  ...
The start of the sequence as triangle array read by rows:
   1;
   2,  3;
   1,  2,  3;
   4,  5,  6,  7;
   1,  2,  3,  4,  5;
   6,  7,  8,  9, 10, 11;
   1,  2,  3,  4,  5,  6,  7;
   8,  9, 10, 11, 12, 13, 14, 15;
   1,  2,  3,  4,  5,  6,  7,  8,  9;
  10, 11, 12, 13, 14, 15, 16, 17, 18, 19;
  ...
Row number r contains r numbers.
If r is  odd: 1,2,3,...,r.
If r is even: r, r+1, r+3, ..., 2*r-1.
The start of the sequence as array read by rows, the length of row r is 4*r-1.
First 2*r-1 numbers are from the row number 2*r-1 of triangle array, located above.
Last 2*r numbers are from the row number 2*r of triangle array, located above.
  1,2,3;
  1,2,3,4,5,6,7;
  1,2,3,4,5,6,7,8,9,10,11;
  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;
  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19;
  ...
Row number r contains 4*r-1 numbers: 1,2,3,...,4*r-1.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := (k+3n-2-(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 17 2018 *)
  • PARI
    T(n,k) = (k+3*n-2-(k+n-2)*(-1)^(k+n))/2; \\ Andrew Howroyd, Jan 11 2018
    
  • Python
    t=int((math.sqrt(8*n-7)-1)/2)
    v=int((t+2)/2)
    result=n-v*(2*v-3)-1

Formula

As table T(n,k) = (k + 3*n - 2 - (k+n-2)*(-1)^(k+n))/2.
As linear sequence
a(n) = A000027(n) - A204164(n)*(2*A204164(n)-3) - 1.
a(n) = n - v*(2*v-3) - 1, where t = floor((-1 + sqrt(8*n-7))/2) and v = floor((t+2)/2).
G.f. of the table: (y*(- 1 + 3*y^2) + x^2*(2 + 5*y - 2*y^2 - 7*y^3) + x^3*(4 + y - 6*y^2 - y^3) + x*(y + 2*y^2 - y^3))/((- 1 + x)^2*(1 + x)^2*(-1 + y)^2*(1 + y)^2). - Stefano Spezia, Nov 17 2018

A202064 Triangle T(n,k), read by rows, given by (2, -1/2, 1/2, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 1/2, -1/2, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 2, 0, 3, 1, 0, 4, 4, 0, 0, 5, 10, 1, 0, 0, 6, 20, 6, 0, 0, 0, 7, 35, 21, 1, 0, 0, 0, 8, 56, 56, 8, 0, 0, 0, 0, 9, 84, 126, 36, 1, 0, 0, 0, 0, 10, 120, 252, 120, 10, 0, 0, 0, 0, 0, 11, 165, 462, 330, 55, 1, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Philippe Deléham, Dec 10 2011

Keywords

Comments

Riordan array (x/(1-x)^2, x^2/(1-x)^2).
Mirror image of triangle in A119900.
A203322*A130595 as infinite lower triangular matrices. - Philippe Deléham, Jan 05 2011
From Gus Wiseman, Jul 07 2025: (Start)
Also the number of subsets of {1..n} containing n with k maximal runs (sequences of consecutive elements increasing by 1). For example, row n = 5 counts the following subsets:
{5} {1,5} {1,3,5}
{4,5} {2,5}
{3,4,5} {3,5}
{2,3,4,5} {1,2,5}
{1,2,3,4,5} {1,4,5}
{2,3,5}
{2,4,5}
{1,2,3,5}
{1,2,4,5}
{1,3,4,5}
For anti-runs instead of runs we have A053538.
Without requiring n see A210039, A202023, reverse A098158, A109446.
(End)

Examples

			Triangle begins :
1
2, 0
3, 1, 0
4, 4, 0, 0
5, 10, 1, 0, 0
6, 20, 6, 0, 0, 0
7, 35, 21, 1, 0, 0, 0
8, 56, 56, 8, 0, 0, 0, 0
		

Crossrefs

Cf. A007318, A005314 (antidiagonal sums), A119900, A084938, A130595, A203322.
Column k = 1 is A000027.
Row sums are A000079.
Column k = 2 is A000292.
Without zeros we have A034867.
Last nonzero term in each row appears to be A124625.
A034839 counts subsets by number of maximal runs, for anti-runs A384893.
A116674 counts strict partitions by number of maximal runs, for anti-runs A384905.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],MemberQ[#,n]&&Length[Split[#,#2==#1+1&]]==k&]],{n,12},{k,n}] (* Gus Wiseman, Jul 07 2025 *)

Formula

G.f.: 1/((1-x)^2-y*x^2).
Sum_{k, 0<=k<=n} T(n,k)*x^k = A000027(n+1), A000079(n), A000129(n+1), A002605(n+1), A015518(n+1), A063727(n), A002532(n+1), A083099(n+1), A015519(n+1), A003683(n+1), A002534(n+1), A083102(n), A015520(n+1), A091914(n) for x = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 10, 11, 12, 13 respectively.
T(n,k) = binomial(n+1,2k+1).
T(n,k) = 2*T(n-1,k) + T(n-2,k-1) - T(n-2,k), T(0,0) = 1, T(1,0) = 2, T(1,1) = 0 and T(n,k) = 0 if k<0 or if k>n. - Philippe Deléham, Mar 15 2012

A299481 Irregular triangle read by rows in which row n lists the odd divisors of n in decreasing order together with the even divisors of n in increasing order.

Original entry on oeis.org

1, 1, 2, 3, 1, 1, 2, 4, 5, 1, 3, 1, 2, 6, 7, 1, 1, 2, 4, 8, 9, 3, 1, 5, 1, 2, 10, 11, 1, 3, 1, 2, 4, 6, 12, 13, 1, 7, 1, 2, 14, 15, 5, 3, 1, 1, 2, 4, 8, 16, 17, 1, 9, 3, 1, 2, 6, 18, 19, 1, 5, 1, 2, 4, 10, 20, 21, 7, 3, 1, 11, 1, 2, 22, 23, 1, 3, 1, 2, 4, 6, 8, 12, 24, 25, 5, 1, 13, 1, 2, 26, 27, 9, 3, 1
Offset: 1

Views

Author

Omar E. Pol, Feb 10 2018

Keywords

Comments

Consider the diagram with overlapping periodic curves that appears in the Links section (figure 1). The number of curves that contain the point [n,0] equals the number of divisors of n. The simpler interpretation of the diagram is that the curve of diameter d represents the divisor d of n. Now here we introduce a new interpretation: the curve of diameter d that contains the point [n,0] represents the divisor c of n, where c = n/d. This version of the model has the property that each odd quadrant centered at [n,0] contains the curves that represent the even divisors of n, and each even quadrant centered at [n,0] contains the curves that represent the odd divisors of n.
We can find the n-th row of the triangle as follows:
Consider only the semicircumferences that contain the point [n,0].
In the second quadrant from bottom to top we can see the curves that represent the odd divisors of n in decreasing order. Also we can see these curves in the fourth quadrant from top to bottom.
Then, if n is an even number, in the first quadrant from top to bottom we can see the curves that represent the even divisors of n in increasing order. Also we can see these curves in the third quadrant from bottom to top (see example).
Sequences of the same family are shown below:
-----------------------------------
Triangle Order of divisors of n
-----------------------------------
This seq. odd v t.w. even ^
A299483 odd ^ t.w. even v
A319844 even v t.w. odd ^
A319845 even ^ t.w. odd v
A319846 odd v t.w. even v
A319847 odd ^ t.w. even ^
A319848 even v t.w. odd v
A319849 even ^ t.w. odd ^
-----------------------------------
In the above table we have that:
"even v" means "even divisors of n in decreasing order".
"even ^" means "even divisors of n in increasing order".
"odd v" means "odd divisors of n in decreasing order".
"odd ^" means "odd divisors of n in increasing order".
"t.w." means "together with".

Examples

			Triangle begins:
   1;
   1,  2;
   3,  1;
   1,  2,  4;
   5,  1;
   3,  1,  2,  6;
   7,  1;
   1,  2,  4,  8;
   9,  3,  1;
   5,  1,  2, 10;
  11,  1;
   3,  1,  2,  4,  6, 12;
  13,  1;
   7,  1,  2, 14;
  15,  5,  3,  1;
   1,  2,  4,  8, 16;
  17,  1;
   9,  3,  1,  2,  6, 18;
  19,  1;
   5,  1,  2,  4, 10, 20;
  21,  7,  3,  1;
  11,  1,  2, 22;
  23,  1;
   3,  1,  2,  4,  6,  8, 12, 24;
  25,  5,  1;
  13,  1,  2, 26;
  27,  9,  3,  1;
   7,  1,  2,  4, 14, 28;
...
For n = 12 the divisors of 12 are [1, 2, 3, 4, 6, 12]. The odd divisors of 12 in decreasing order are [3, 1], and the even divisors of 12 in increasing order are [2, 4, 6, 12], so the 12th row of triangle is [3, 1, 2, 4, 6, 12].
On the other hand, consider the diagram that appears in the Links section (figure 1). Then consider only the semicircumferences that contain the point [12,0]. In the second quadrant, from bottom to top, we can see the curves with diameters [4, 12]. Also we can see these curves in the fourth quadrant from top to bottom. The associated numbers c = 12/d are [3, 1] respectively. These are the odd divisors of 12 in decreasing order. Then, in the first quadrant, from top to bottom, we can see the curves with diameters [6, 3, 2, 1]. Also we can see these curves in the third quadrant from bottom to top. The associated numbers c = 12/d are [2, 4, 6, 12] respectively. These are the even divisors of n in increasing order. Finally all numbers c obtained are [3, 1, 2, 4, 6, 12] equaling the 12th row of triangle.
		

Crossrefs

Row sums give A000203.
Row n has length A000005(n).
Alternating borders give A000027.
Right border gives A124625 without its first two terms.

Programs

  • PARI
    row(n) = my(d=divisors(n)); concat(Vecrev(select(x->(x%2), d)), select(x->!(x%2), d));
    lista(nn) = {for (n=1, nn, my(r = row(n)); for (k=1, #r, print1(r[k], ", ")););} \\ Michel Marcus, Jan 17 2019

A202023 Triangle T(n,k), read by rows, given by (1, 0, 1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 1, -1, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 3, 0, 0, 1, 6, 1, 0, 0, 1, 10, 5, 0, 0, 0, 1, 15, 15, 1, 0, 0, 0, 1, 21, 35, 7, 0, 0, 0, 0, 1, 28, 70, 28, 1, 0, 0, 0, 0, 1, 36, 126, 84, 9, 0, 0, 0, 0, 0, 1, 45, 210, 210, 45, 1, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Philippe Deléham, Dec 10 2011

Keywords

Comments

Riordan array (1/(1-x), x^2/(1-x)^2).
A skewed version of triangular array A085478.
Mirror image of triangle in A098158.
Sum_{k, 0<=k<=n} T(n,k)*x^k = A138229(n), A006495(n), A138230(n),A087455(n), A146559(n), A000012(n), A011782(n), A001333(n),A026150(n), A046717(n), A084057(n), A002533(n), A083098(n),A084058(n), A003665(n), A002535(n), A133294(n), A090042(n),A125816(n), A133343(n), A133345(n), A120612(n), A133356(n), A125818(n) for x = -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 respectively.
Sum_{k, 0<=k<=n} T(n,k)*x^(n-k) = A009116(n), A000007(n), A011782(n), A006012(n), A083881(n), A081335(n), A090139(n), A145301(n), A145302(n), A145303(n), A143079(n) for x = -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 respectively.
From Gus Wiseman, Jul 08 2025: (Start)
After the first row this is also the number of subsets of {1..n-1} with k maximal runs (sequences of consecutive elements increasing by 1) for k = 0..n. For example, row n = 5 counts the following subsets:
{} {1} {1,3} . . .
{2} {1,4}
{3} {2,4}
{4} {1,2,4}
{1,2} {1,3,4}
{2,3}
{3,4}
{1,2,3}
{2,3,4}
{1,2,3,4}
Requiring n-1 gives A202064.
For anti-runs instead of runs we have A384893.
(End)

Examples

			Triangle begins :
1
1, 0
1, 1, 0
1, 3, 0, 0
1, 6, 1, 0, 0
1, 10, 5, 0, 0, 0
1, 15, 15, 1, 0, 0, 0
1, 21, 35, 7, 0, 0, 0, 0
1, 28, 70, 28, 1, 0, 0, 0, 0
		

Crossrefs

Column k = 1 is A000217.
Column k = 2 is A000332.
Row sums are A011782 (or A000079 shifted right).
Removing all zeros gives A034839 (requiring n-1 A034867).
Last nonzero term in each row appears to be A093178, requiring n-1 A124625.
Reversing rows gives A098158, without zeros A109446.
Without the k = 0 column we get A210039.
Row maxima appear to be A214282.
A116674 counts strict partitions by number of maximal runs, for anti-runs A384905.
A268193 counts integer partitions by number of maximal runs, for anti-runs A384881.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n-1]],Length[Split[#,#2==#1+1&]]==k&]],{n,0,10},{k,0,n}] (* Gus Wiseman, Jul 08 2025 *)

Formula

T(n,k) = binomial(n,2k).
G.f.: (1-x)/((1-x)^2-y*x^2).
T(n,k)= Sum_{j, j>=0} T(n-1-j,k-1)*j with T(n,0)=1 and T(n,k)= 0 if k<0 or if n
T(n,k) = 2*T(n-1,k) + T(n-2,k-1) - T(n-2,k) for n>1, T(0,0) = T(1,0) = 1, T(1,1) = 0, T(n,k) = 0 if k>n or if k<0. - Philippe Deléham, Nov 10 2013

A129889 Write down n, then n*(n+1).

Original entry on oeis.org

0, 0, 1, 2, 2, 6, 3, 12, 4, 20, 5, 30, 6, 42, 7, 56, 8, 72, 9, 90, 10, 110, 11, 132, 12, 156, 13, 182, 14, 210, 15, 240, 16, 272, 17, 306, 18, 342, 19, 380, 20, 420, 21, 462, 22, 506, 23, 552, 24, 600, 25, 650, 26, 702, 27, 756, 28, 812, 29, 870, 30, 930, 31, 992, 32, 1056, 33
Offset: 0

Author

N. J. A. Sloane, May 26 2007

Keywords

Crossrefs

Cf. A124625.

Programs

  • Magma
    [IsEven(n) select n/2 else (n^2-1)/4: n in [0..66]]; // Bruno Berselli, May 06 2011
  • Maple
    f:=n-> if n mod 2 = 0 then n/2 else (n^2-1)/4; fi;
  • Mathematica
    Flatten[Table[{n,n(n+1)},{n,0,40}]] (* Harvey P. Dale, Jun 21 2015 *)

Formula

From Bruno Berselli, May 06 2011: (Start)
G.f.: x^2*(1+2*x-x^2)/(1-x^2)^3.
a(n) = ((1+2*n-n^2)*(-1)^n -(1-2*n-n^2))/8.
a(n) = a(n-2) + A124625(n) for n>1. (End)

A375797 Table T(n, k) read by upward antidiagonals. The sequences in each column k is a triangle read by rows (blocks), where each row is a permutation of the numbers of its constituents. Row number n in column k has length n*k = A003991(n,k); see Comments.

Original entry on oeis.org

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

Author

Boris Putievskiy, Aug 29 2024

Keywords

Comments

A208233 presents an algorithm for generating permutations, where each generated permutation is self-inverse.
The sequence in each column k possesses two properties: it is both a self-inverse permutation and an intra-block permutation of natural numbers.

Examples

			Table begins:
    k=    1   2   3   4   5   6
  -----------------------------------
  n= 1:   1,  1,  3,  1,  5,  1, ...
  n= 2:   2,  2,  2,  3,  2,  5, ...
  n= 3:   3,  3,  1,  2,  3,  3, ...
  n= 4:   6,  5,  4,  4,  4,  4, ...
  n= 5:   5,  4,  8,  5,  1,  2, ...
  n= 6:   4,  6,  6, 11,  6,  6, ...
  n= 7:   7,  7,  7,  7, 14,  7, ...
  n= 8:   9, 11,  5,  9,  8, 17, ...
  n= 9:   8,  9,  9,  8, 12,  9, ...
  n= 10: 10, 10, 18, 10, 10, 15, ...
  n= 11: 15,  8, 11,  6, 11, 11, ...
  n= 12: 12, 12, 16, 12,  9, 13, ...
  n= 13: 13, 13, 13, 13, 13, 12, ...
  n= 14: 14, 19, 14, 23,  7, 14, ...
  n= 15: 11, 15, 15, 15, 15, 10, ...
  n= 16: 16, 17, 12, 21, 30, 16, ...
  n= 17: 20, 16, 17, 17, 17,  8, ...
  n= 18: 18, 18, 10, 19, 28, 18, ...
     ... .
In column 3, the first 3 blocks have lengths 3,6 and 9. In column 6, the first 2 blocks have lengths 6 and 12. Each block is a permutation of the numbers of its constituents.
The first 6 antidiagonals are:
  1;
  2,1;
  3,2,3;
  6,3,2,1;
  5,5,1,3,5;
  4,4,4,2,2,1;
		

Programs

  • Mathematica
    T[n_,k_]:=Module[{L,R,P,result},L=Ceiling[(Sqrt[8*n*k+k^2]-k)/(2*k)]; R=n-k*(L-1)*L/2; P=(((-1)^Max[R,k*L+1-R]+1)*R-((-1)^Max[R,k*L+1-R]-1)*(k*L+1-R))/2; result=P+k*(L-1)*L/2]
    Nmax=18; Table[T[n,k],{n,1,Nmax},{k,1,Nmax}]

Formula

T(n,k) = P(n,k) + k*(L(n,k)-1)*L(n,k)/2 = P(n,k) + A062707(L(n-1),k), where L(n,k) = ceiling((sqrt(8*n*k+k^2)-k)/(2*k)), R(n,k) = n-k*(L(n,k)-1)*L(n,k)/2, P(n,k) = (((-1)^max(R(n,k),k*L(n,k)+1-R(n,k))+1)*R(n,k)-((-1)^max(R(n,k),k*L(n,k)+1-R(n,k))-1)*(k*L(n,k)+1-R(n,k)))/2.
T(n,1) = A188568(n). T(1,k) = A093178(k). T(n,n) = A124625(n). L(n,1) = A002024(n). L(n,2) = A000194(n). L(n,3) = A111651(n). L(n,4) = A371355(n). R(n,1) = A002260(n). R(n,2) = A074294(n).
Showing 1-10 of 13 results. Next