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

A080856 a(n) = 8*n^2 - 4*n + 1.

Original entry on oeis.org

1, 5, 25, 61, 113, 181, 265, 365, 481, 613, 761, 925, 1105, 1301, 1513, 1741, 1985, 2245, 2521, 2813, 3121, 3445, 3785, 4141, 4513, 4901, 5305, 5725, 6161, 6613, 7081, 7565, 8065, 8581, 9113, 9661, 10225, 10805, 11401, 12013, 12641, 13285, 13945, 14621
Offset: 0

Views

Author

Paul Barry, Feb 23 2003

Keywords

Comments

The old definition of this sequence was "Generalized polygonal numbers".
Row T(4,n) of A080853.
{a(k): 0 <= k < 3} = divisors of 25. - Reinhard Zumkeller, Jun 17 2009
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=4, (i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=3, a(n-1)= coeff(charpoly(A,x),x^(n-2)). - Milan Janjic, Jan 27 2010
Also sequence found by reading the segment (1, 5) together with the line from 5, in the direction 5, 25,..., in the square spiral whose vertices are the generalized hexagonal numbers A000217. - Omar E. Pol, Nov 05 2012
For n > 0: A049061(a(n)) = 0, when the triangle of "signed Eulerian numbers" in A049061 is seen as flattened sequence. - Reinhard Zumkeller, Jan 31 2013

Crossrefs

A060820 is another version (but the present sequence is the main entry).
A row of the array in A386478.

Programs

Formula

G.f.: (1+2*x+13*x^2)/(1-x)^3.
a(n) = A060820(n), n>0. - R. J. Mathar, Sep 18 2008
a(n) = C(n,0) + 4*C(n,1) + 16*C(n,2). - Reinhard Zumkeller, Jun 17 2009
a(n) = 16*n+a(n-1)-12 with n>0, a(0)=1. - Vincenzo Librandi, Aug 08 2010
E.g.f.: (8*x^2 + 4*x + 1)*exp(x). - G. C. Greubel, Jun 16 2017

Extensions

Definition replaced with the closed form by Bruno Berselli, Jan 16 2013

A125300 Tanimoto triangle read by rows: T(n,k) = number of "parity-alternating permutations" (PAPS) of n symbols with k ascents.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 3, 3, 1, 1, 2, 6, 2, 1, 1, 9, 26, 26, 9, 1, 1, 8, 39, 48, 39, 8, 1, 1, 23, 165, 387, 387, 165, 23, 1, 1, 22, 228, 674, 1030, 674, 228, 22, 1, 1, 53, 860, 4292, 9194, 9194, 4292, 860, 53, 1, 1, 52, 1149, 7136, 20738, 28248, 20738, 7136, 1149, 52, 1
Offset: 1

Views

Author

Jonathan Vos Post, Dec 08 2006, Dec 11 2006

Keywords

Comments

A permutation is a parity-alternating permutation (PAP) if its entries take even and odd integers alternately (examples: 436125, 563412 or 7216345). When n is an odd integer, odd entries must appear at both ends of PAPs. T(n,k) = the number of PAPs of {1,2,...,n} with exactly k ascents. Row sums = 2*((n/2)!)^2 if n is even and ((n+1)/2)!*((n-1)/2)! if n is odd.
Arises in combinatorial analysis of signed Eulerian numbers and parity-alternate permutations. This table is the first of three tables on p. 4 of the Tanimoto reference.

Examples

			Triangle begins:
n=1.|.1
n=2.|.1....1
n=3.|.1....0....1
n=4.|.1....3....3....1
n=5.|.1....2....6....2....1
n=6.|.1....9...26...26....9....1
n=7.|.1....8...39...48...39....8....1
n=8.|.1...23..165..387..387..165...23....1
n=9.|.1...22..228..674.1030..674..228...22....1
n=10|.1...53..860.4292.9194.9194.4292..860...53....1
Examples of parity-alternating permutations of n=5 and their number of rises k are [1,2,3,4,5] (k=4, only rises), [1,2,5,4,3] (k=2: 1->2 and 2->5), [1,4,3,2,5] (k=2: 1->4 and 2->5).  The T(n=5,k=1)=2 parity-alternating permutations with k=1 rise are [3,2,5,4,1] and [5,2,1,4,3].
		

Crossrefs

Cf. A008292 = Triangle of Eulerian numbers T(n, k) read by rows, A049061 = Triangle a(n, k) (1<=k<=n) of signed Eulerian numbers.
Row sums give: A092186. - Alois P. Heinz, Nov 18 2013

Programs

  • Maple
    isPAP := proc(per) local i ; for i from 2 to nops(per) do if ( op(i,per) mod 2 ) = (op(i-1,per) mod 2 ) then RETURN(false) ; fi ; od : RETURN(true) ; end: ascents := proc(per) local i, asc ; asc :=0 ; for i from 2 to nops(per) do if op(i,per) > op (i-1,per) then asc := asc+1 : fi ; od : RETURN(asc) ; end:
    A125300row := proc(n) local per,resul, asc,thisp,p,i,row ; row := array(0..n-1) ; for i from 0 to n-1 do row[i] := 0 : od ; per := combinat[permute](n) ; for p from 1 to nops(per) do asc := 0 ; thisp := op(p,per) ; if isPAP(thisp) then asc := ascents(thisp) ; row[asc] := row[asc]+1 ; fi ; od ; RETURN(row) : end: for n from 2 to 10 do r := A125300row(n) ; for k from 0 to n-1 do print(r[k]) ; od : od : # R. J. Mathar, Dec 12 2006
  • Mathematica
    isPAP[per_] := (For[i = 2, i <= Length[per], i++, If [Mod[per[[i]], 2] == Mod[per[[i - 1]], 2], Return[False] ] ]; True);
    ascents[per_] := (asc = 0; For[i = 2, i <= Length[per], i++, If[per[[i]] > per[[i - 1]],  asc ++] ]; asc);
    A125300row[n_] := (row = Range[0, n - 1]; For[i = 0, i <= n - 1, i++, row[[i]] = 0]; per = Permutations[Range[n]]; For[p = 1, p <= Length[per], p++, asc = 0; thisp = per[[p]]; If[isPAP[thisp], asc = ascents[thisp]; row[[asc]] += 1]]; row);
    Join[{1}, Reap[For[n = 2, n <= 10, n++, r = A125300row[n]; For[k = 0, k <= n - 1, k++, Print[r[[k]]]; Sow[r[[k]]]]]][[2, 1]]] (* Jean-François Alcover, Nov 07 2017, after R. J. Mathar's Maple code *)

Formula

T(n,k) = T(n,n-k-1).

Extensions

Corrected by R. J. Mathar, Dec 12 2006
Edited by N. J. A. Sloane, Dec 21 2006
Replaced arXiv URL by non-cached version - R. J. Mathar, Oct 30 2009
More terms from Alois P. Heinz, Nov 18 2013

A128612 Triangle T(n,k) read by rows: number of permutations in [n] with exactly k ascents that have an even number of inversions.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 1, 5, 5, 1, 1, 14, 30, 14, 1, 0, 28, 155, 147, 29, 1, 0, 56, 605, 1208, 586, 64, 1, 1, 127, 2133, 7819, 7819, 2133, 127, 1, 1, 262, 7288, 44074, 78190, 44074, 7288, 262, 1, 0, 496, 23947, 227623, 655039, 655315, 227569, 23893, 517, 1, 0, 992, 76305, 1102068, 4868556, 7862124, 4869558, 1101420, 76332, 1044, 1
Offset: 1

Views

Author

Ralf Stephan, May 08 2007

Keywords

Examples

			Triangle starts:
  1;
  0,   1;
  0,   2,    1;
  1,   5,    5,    1;
  1,  14,   30,   14,    1;
  0,  28,  155,  147,   29,    1;
  0,  56,  605, 1208,  586,   64,   1;
  1, 127, 2133, 7819, 7819, 2133, 127, 1;
  ...
		

Crossrefs

Cf. A145882 (similar with rows reversed).
Row sums give A001710.
T(2n,n) gives A382309.

Programs

  • Maple
    A008292 := proc(n,k) local j; add( (-1)^j*(k-j)^n*binomial(n+1,j),j=0..k) ; end: A049061 := proc(n,k) if k <= 0 or n <=0 or k > n then 0; elif n = 1 then 1 ; elif n mod 2 = 0 then A049061(n-1,k)-A049061(n-1,k-1) ; else k*A049061(n-1,k)+(n-k+1)*A049061(n-1,k-1) ; fi ; end: A128612 := proc(n,k) (A008292(n,n-k)+A049061(n,n-k))/2 ; end: for n from 1 to 11 do for k from 0 to n-1 do printf("%d,",A128612(n,k)) ; od: od: # R. J. Mathar, Nov 01 2007
    # second Maple program:
    b:= proc(u, o, i) option remember; expand(`if`(u+o=0, 1-i,
           add(b(u+j-1, o-j, irem(i+u+j-1, 2)), j=1..o)*x+
           add(b(u-j, o+j-1, irem(i+u-j, 2)), j=1..u)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n-1))(b(n, 0$2)):
    seq(T(n), n=1..14);  # Alois P. Heinz, May 02 2017
  • Mathematica
    b[u_, o_, i_] := b[u, o, i] = Expand[If[u + o == 0, 1 - i, Sum[b[u + j - 1, o - j, Mod[i + u + j - 1, 2]], {j, 1, o}]*x + Sum[b[u - j, o + j - 1, Mod[i + u - j, 2]], {j, 1, u}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n-1}]][b[n, 0,0]];
    Table[T[n], {n, 1, 14}] // Flatten (* Jean-François Alcover, Jul 25 2017, after Alois P. Heinz *)

Formula

T(n,k) = (1/2) * (A008292(n,n-k) + A049061(n,n-k)), n>=1, 0<=kR. J. Mathar, Nov 01 2007

Extensions

More terms from R. J. Mathar, Nov 01 2007

A373657 Triangle read by rows: Coefficients of the polynomials P(n, x) * EP(n, x), where P denote the signed Pascal polynomials and EP the Eulerian polynomials A173018.

Original entry on oeis.org

1, -1, 1, 1, -1, -1, 1, -1, -1, 8, -8, 1, 1, 1, 7, -27, 19, 19, -27, 7, 1, -1, -21, 54, 54, -276, 276, -54, -54, 21, 1, 1, 51, -25, -675, 1650, -1002, -1002, 1650, -675, -25, 51, 1, -1, -113, -372, 3436, -5125, -5013, 21216, -21216, 5013, 5125, -3436, 372, 113, 1
Offset: 0

Views

Author

Peter Luschny, Jun 15 2024

Keywords

Examples

			Triangle starts:
[0] [ 1]
[1] [-1,   1]
[2] [ 1,  -1,  -1,    1]
[3] [-1,  -1,   8,   -8,    1,     1]
[4] [ 1,   7, -27,   19,   19,   -27,     7,    1]
[5] [-1, -21,  54,   54, -276,   276,   -54,  -54,   21,   1]
[6] [ 1,  51, -25, -675, 1650, -1002, -1002, 1650, -675, -25, 51, 1]
		

Crossrefs

Cf. A173018, A049061, A101842, A000007 (row sums).

Programs

  • Maple
    PolyProd := proc(P, Q, len) local ep, eq, epq, CL, n, k;
    ep := (n, x) -> simplify(add(Q(n, k)*x^k, k = 0..n)):
    eq := (n, x) -> simplify(add(P(n, k)*x^k, k = 0..n)):
    epq := (n, x) -> expand(ep(n, x) * eq(n, x)):
    CL := p -> PolynomialTools:-CoefficientList(p, x);
    seq(CL(epq(n, x)), n = 0..len); ListTools:-Flatten([%]) end:
    PolyProd((n, k) -> (-1)^(n-k)*binomial(n, k), combinat:-eulerian1, 7);

A128613 Triangle T(n,k) read by rows: number of permutations in [n] with exactly k ascents that have an odd number of inversions.

Original entry on oeis.org

0, 1, 0, 1, 2, 0, 0, 6, 6, 0, 0, 12, 36, 12, 0, 1, 29, 147, 155, 28, 0, 1, 64, 586, 1208, 605, 56, 0, 0, 120, 2160, 7800, 7800, 2160, 120, 0, 0, 240, 7320, 44160, 78000, 44160, 7320, 240, 0, 1, 517, 23893, 227569, 655315, 655039, 227623, 23947, 496, 0, 1, 1044, 76332, 1101420, 4869558, 7862124, 4868556, 1102068, 76305, 992, 0
Offset: 1

Views

Author

Ralf Stephan, May 08 2007

Keywords

Examples

			Triangle starts:
  0;
  1,   0;
  1,   2,    0;
  0,   6,    6,    0;
  0,  12,   36,   12,    0;
  1,  29,  147,  155,   28,    0;
  1,  64,  586,  120,  605,   56,   0;
  0, 120, 2160, 7800, 7800, 2160, 120, 0;
  ...
		

Crossrefs

Programs

  • Maple
    A008292 := proc(n,k) local j; add( (-1)^j*(k-j)^n*binomial(n+1,j),j=0..k) ; end: A049061 := proc(n,k) if k <= 0 or n <=0 or k > n then 0; elif n = 1 then 1 ; elif n mod 2 = 0 then A049061(n-1,k)-A049061(n-1,k-1) ; else k*A049061(n-1,k)+(n-k+1)*A049061(n-1,k-1) ; fi ; end: A128613 := proc(n,k) (A008292(n,n-k)-A049061(n,n-k))/2 ; end: for n from 1 to 11 do for k from 0 to n-1 do printf("%d,",A128613(n,k)) ; od: od: # R. J. Mathar, Nov 01 2007
    # second Maple program:
    b:= proc(u, o, i) option remember; expand(`if`(u+o=0, i,
           add(b(u+j-1, o-j, irem(i+u+j-1, 2)), j=1..o)*x+
           add(b(u-j, o+j-1, irem(i+u-j, 2)), j=1..u)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n-1))(b(n, 0$2)):
    seq(T(n), n=1..14);  # Alois P. Heinz, May 02 2017
  • Mathematica
    b[u_, o_, i_] := b[u, o, i] = Expand[If[u + o == 0, i, Sum[b[u + j - 1, o - j, Mod[i + u + j - 1, 2]], {j, 1, o}]*x + Sum[b[u - j, o + j - 1, Mod[i + u - j, 2]], {j, 1, u}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, n-1}]][b[n, 0,0]];
    Table[T[n], {n, 1, 14}] // Flatten (* Jean-François Alcover, Jul 25 2017, after Alois P. Heinz *)

Formula

a(n) = 1/2 * (A008292(n,k) - A049061(n,k)).
T(n,k) = 1/2 * (A008292(n,n-k) - A049061(n,n-k)), n>=1, 0<=kR. J. Mathar, Nov 01 2007

Extensions

Corrected and extended by R. J. Mathar, Nov 01 2007

A263985 Triangle of signed Eulerian numbers on involutions, read by rows.

Original entry on oeis.org

1, -1, 1, -1, -2, 1, 1, -2, -2, 1, 1, 6, 0, -2, 1, -1, 3, 14, 2, -3, 1, -1, -12, -15, 12, -1, -4, 1, 1, -4, -51, -76, 4, -3, -4, 1, 1, 20, 67, -10, -80, 30, 3, -4, 1, -1, 5, 137, 517, 414, 66, 75, 7, -5, 1, -1, -30, -192, -140, 721, 588, -49, 44, 0, -6, 1
Offset: 1

Views

Author

Michel Marcus, Oct 31 2015

Keywords

Examples

			Triangle begins:
1;
-1, 1;
-1, -2, 1;
1, -2, -2, 1;
1, 6, 0, -2, 1;
-1, 3, 14, 2, -3, 1;
-1, -12, -15, 12, -1, -4, 1;
...
		

Crossrefs

Cf. A049061.

Programs

  • Mathematica
    T[n_, k_] := Sum[(-1)^(k-m+1) Binomial[n+1, k-m+1] Sum[(-1)^j Binomial[ Binomial[m+1, 2]+j-1, j] Binomial[m, n-2j], {j, 0, n/2}], {m, 0, k+1}];
    Table[T[n, k], {n, 1, 11}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, Sep 26 2018 *)
  • PARI
    T(n, k) = sum(m=0, k+1, (-1)^(k-m+1)*binomial(n+1,k-m+1)*sum(j=0,n\2, (-1)^j*binomial(binomial(m+1,2)+j-1,j)*binomial(m,n-2*j)));

Formula

T(n, k) = Sum_{m=0..k+1} (-1)^(k-m+1)*C(n+1,k-m+1)*Sum_{j=0..floor(n/2)} (-1)^j*C(C(m+1,2)+j-1,j)*C(m,n-2*j);
Showing 1-6 of 6 results.