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

A257609 Triangle read by rows: T(n,k) = t(n-k, k); t(n,m) = f(m)*t(n-1,m) + f(n)*t(n,m-1), where f(x) = 2*x + 2.

Original entry on oeis.org

1, 2, 2, 4, 16, 4, 8, 88, 88, 8, 16, 416, 1056, 416, 16, 32, 1824, 9664, 9664, 1824, 32, 64, 7680, 76224, 154624, 76224, 7680, 64, 128, 31616, 549504, 1999232, 1999232, 549504, 31616, 128, 256, 128512, 3739648, 22587904, 39984640, 22587904, 3739648, 128512, 256
Offset: 0

Views

Author

Dale Gerdemann, May 03 2015

Keywords

Examples

			Triangle begins as:
    1;
    2,      2;
    4,     16,       4;
    8,     88,      88,        8;
   16,    416,    1056,      416,       16;
   32,   1824,    9664,     9664,     1824,       32;
   64,   7680,   76224,   154624,    76224,     7680,      64;
  128,  31616,  549504,  1999232,  1999232,   549504,   31616,    128;
  256, 128512, 3739648, 22587904, 39984640, 22587904, 3739648, 128512, 256;
		

Crossrefs

Similar sequences listed in A256890.

Programs

  • Magma
    function T(n,k,a,b)
      if k lt 0 or k gt n then return 0;
      elif k eq 0 or k eq n then return 1;
      else return (a*k+b)*T(n-1,k,a,b) + (a*(n-k)+b)*T(n-1,k-1,a,b);
      end if; return T;
    end function;
    [T(n,k,2,2): k in [0..n], n in [0..12]]; // G. C. Greubel, Mar 21 2022
    
  • Magma
    A257609:= func< n,k | 2^n*EulerianNumber(n+1, k) >;
    [A257609(n,k): k in [0..n], n in [0..10]]; // G. C. Greubel, Jan 17 2025
    
  • Mathematica
    T[n_, k_, a_, b_]:= T[n, k, a, b]= If[k<0 || k>n, 0, If[n==0, 1, (a*(n-k)+b)*T[n-1, k-1, a, b] + (a*k+b)*T[n-1, k, a, b]]];
    Table[T[n,k,2,2], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Mar 21 2022 *)
  • Sage
    def T(n,k,a,b): # A257609
        if (k<0 or k>n): return 0
        elif (n==0): return 1
        else: return  (a*k+b)*T(n-1,k,a,b) + (a*(n-k)+b)*T(n-1,k-1,a,b)
    flatten([[T(n,k,2,2) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Mar 21 2022

Formula

T(n,k) = t(n-k, k); t(0,0) = 1, t(n,m) = 0 if n < 0 or m < 0, else t(n,m) = f(m)*t(n-1,m) + f(n)*t(n,m-1), where f(x) = 2*x + 2.
Sum_{k=0..n} T(n, k) = A002866(n).
From G. C. Greubel, Mar 21 2022: (Start)
T(n, k) = (a*k + b)*T(n-1, k) + (a*(n-k) + b)*T(n-1, k-1), with T(n, 0) = 1, a = 2, and b = 2.
T(n, n-k) = T(n, k).
T(n, 0) = A000079(n).
T(n, 1) = 2*A100575(n+1). (End)
T(n, k) = 2^n*A008292(n+1, k+1). - G. C. Greubel, Jan 17 2025

A000431 Expansion of 2*x^3/((1-2*x)^2*(1-4*x)).

Original entry on oeis.org

0, 0, 0, 2, 16, 88, 416, 1824, 7680, 31616, 128512, 518656, 2084864, 8361984, 33497088, 134094848, 536608768, 2146926592, 8588754944, 34357248000, 137433710592, 549744803840, 2199000186880, 8796044787712, 35184271425536, 140737278640128, 562949517213696
Offset: 0

Views

Author

Keywords

Comments

Number of permutations of length n with exactly one valley. Also (for n>0), the number of ways to pick two of the 2^(n-1) vertices of an n-1 cube that are not connected by an edge. - Aaron Meyerowitz, Apr 21 2014
a(n+1), n >= 1: Number of independent vertex pairs for Q_n, n >= 1: 2^(n-1) * (2^n - (n+1)) = T_(2^n - 1) - n * 2^(n-1) = L_n - E_n = A006516(n) - A001787(n), where L_n is the number of vertex pairs and E_n is the number of vertex pairs yielding edges. (Cf. A027624.) - Daniel Forgues, Feb 19 2015
From Petros Hadjicostas, Aug 08 2019: (Start)
Apparently, by saying "valley" of a permutation of [n], Aaron Meyerowitz indirectly assumes that a "valley" is an interior minimum of a permutation (i.e., we ignore possible minima at the endpoints). Since the complement of a permutation b_1 b_2 ... b_n (using one-line notation, not cycle notation) is (n+1-b_1) (n+1-b_2) ... (n+1-b_n), the current sequence is also the number of permutations of [n] with exactly one peak (that is, exactly one interior maximum).
Comtet (pp. 260-261 in his book) calls these peaks "intermediary peaks" to distinguish them from "left peaks" and "right peaks" (i.e., maxima at the endpoints).
(End)

Examples

			From _Petros Hadjicostas_, Aug 08 2019: (Start)
We have a(3) = 2 because the permutations 123, 132, 213, 231, 312, and 321 have exactly 0, 1, 0, 1, 0, and 0 peaks, respectively. Also, they have 0, 0, 1, 0, 1, and 0 valleys, respectively.
Note that permutations 132 and 231 (each one with 1 peak) are complements of permutations 312 and 213, respectively (each one with 1 valley).
Also, a(4) = 16 because
1234 -> 0 peaks and 0 valleys (complement of 4321);
1243 -> 1 peak and  0 valleys (complement of 4312);
1324 -> 1 peak and 1 valley (complement of 4231);
1342 -> 1 peak and 0 valleys (complement of 4213);
1423 -> 1 peak and 1 valley (complement of 4132);
1432 -> 1 peal and 0 valleys (complement of 4123);
2134 -> 0 peaks and 1 valley (complement of 3421);
2143 -> 1 peak and 1 valley (complement of 3412);
2314 -> 1 peak and 1 valley (complement of 3241);
2341 -> 1 peak and 0 valleys (complement of 3214);
2413 -> 1 peak and 1 valley (complement of 3142);
2431 -> 1 peak and 0 valleys (complement of 3124);
3124 -> 0 peaks and 1 valley (complement of 2431);
3142 -> 1 peak and 1 valley (complement of 2413);
3214 -> 0 peaks and 1 valley (complement of 2341);
3241 -> 1 peak and 1 valley (complement of 2314);
3412 -> 1 peak and 1 valley (complement of 2143);
3421 -> 1 peak and 0 valleys (complement of 2134);
4123 -> 0 peaks and 1 valley (complement of 1432);
4132 -> 1 peak and 1 valley (complement of 1423);
4213 -> 0 peaks and 1 valley (complement of 1342);
4231 -> 1 peak and 1 valleys (complement of 1324);
4312 -> 0 peaks and 1 valley (complement of 1243);
4321 -> 0 peaks and 0 valleys (complement of 1234).
(End)
		

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 261.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=1 of A008303.

Programs

  • Magma
    [0] cat [(4^n - n*2^(n+1))/8: n in [1..30]]; // Vincenzo Librandi, Feb 18 2015
    
  • Maple
    A000431:=-2/(4*z-1)/(-1+2*z)**2; # Conjectured by Simon Plouffe in his 1992 dissertation. [Proved by Désiré André, 1895, p.154, for circular permutations (see A008303). Peter Luschny, Aug 07 2019]
    a:= n-> if n=0 then 0 else (Matrix([[2,0,0]]). Matrix(3, (i,j)-> if (i=j-1) then 1 elif j=1 then [8,-20,16][i] else 0 fi)^(n-1))[1,3] fi: seq(a(n), n=0..30); # Alois P. Heinz, Aug 26 2008
  • Mathematica
    nn = 30; CoefficientList[Series[2*x^3/((1 - 2*x)^2*(1 - 4*x)), {x, 0, nn}], x] (* T. D. Noe, Jun 20 2012 *)
    Join[{0}, LinearRecurrence[{8, -20, 16}, {0, 0, 2}, 30]] (* Jean-François Alcover, Jan 31 2016 *)
  • PARI
    concat(vector(3), Vec(2*x^3/((1-2*x)^2*(1-4*x)) + O(x^40))) \\ Michel Marcus, Jan 31 2016

Formula

From Mitch Harris, Apr 02 2004: (Start)
a(n) = Sum_{1..2^(n+1) - 1} A007814(k).
a(n) = (4^n - n 2^(n+1))/8 for n >= 1.
(End)
a(n) = 2*A100575(n-1). - R. J. Mathar, Mar 14 2011
a(n) = 2^(n-2) * (2^(n-1) - n), n >= 1. - Daniel Forgues, Feb 24 2015

A384868 a(n) = Sum_{i=1...|b|} i*(-1)^b_i where b is the lexicographically n-th binary string.

Original entry on oeis.org

0, 1, -1, 3, -1, 1, -3, 6, 0, 2, -4, 4, -2, 0, -6, 10, 2, 4, -4, 6, -2, 0, -8, 8, 0, 2, -6, 4, -4, -2, -10, 15, 5, 7, -3, 9, -1, 1, -9, 11, 1, 3, -7, 5, -5, -3, -13, 13, 3, 5, -5, 7, -3, -1, -11, 9, -1, 1, -9, 3, -7, -5, -15, 21, 9, 11, -1, 13, 1, 3, -9, 15, 3, 5, -7, 7, -5, -3, -15, 17
Offset: 0

Views

Author

Christopher Purcell, Jun 11 2025

Keywords

Comments

The first binary string is the empty string and is indexed n=0.

Examples

			The lexicographically 8th binary string is 001; therefore, a(8) = 1 + 2 - 3 = 0.
Sequence can be written as triangle T(n,k) with row lengths 2^n:
   0;
   1, -1;
   3, -1, 1, -3;
   6,  0, 2, -4, 4, -2, 0, -6;
  10,  2, 4, -4, 6, -2, 0, -8, 8, 0, 2, -6, 4, -4, -2, -10;
  ...
		

Crossrefs

Programs

  • PARI
    a(n) = my(b=[d|d<-binary(n+1)[^1]]); sum(i=1, #b, i*(-1)^b[i]); \\ Michel Marcus, Jun 11 2025
    
  • Python
    from math import comb
    def A384868(n): return comb(len(s:=bin(n+1)[3:])+1,2)-(sum(i for i,j in enumerate(s,1) if j=='1')<<1) # Chai Wah Wu, Jun 13 2025
    
  • Python
    def a384868(n): return sum(i if b == '0' else -i for i, b in enumerate(bin(n + 1)[3:], 1)) # David Radcliffe, Jun 15 2025

Formula

From Alois P. Heinz, Jun 13 2025: (Start)
a(A000225(n)) = A000217(n).
a(2*(2^n-1)) = (-1)*A000217(n).
Sum_{i=0..2^n-1} a(i+2^n-1) = 0.
Sum_{i=0..2^n-1} i*a(i+2^n-1) = (-1)*A100575(n+1).
Sum_{i=0..2^n-1} abs(a(i+2^n-1)) = 2*A377170(n). (End)

A130662 1/512 the number of permutations of 0..n with exactly 6 maxima.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 691, 43688, 1553322, 41048184, 900113808, 17353890816, 304617949952, 4981087243264, 77092396405248, 1142386254729216, 16347546554540544, 227391442095863808, 3090231533090021376, 41195837323058675712, 540459023153920671744
Offset: 0

Views

Author

R. H. Hardin, Aug 11 2007

Keywords

Comments

a(n) = A179709(n+1)/512.

Crossrefs

Cf. A100575.

Formula

G.f.: -x^10* (2090188800*x^10 -5075343360*x^9 +5480510976*x^8 -3456747648*x^7 +1407037152*x^6 -385459712*x^5 +71872912*x^4 -8997896*x^3 +723346*x^2 -33704*x+691) / ((12*x-1) *(10*x-1)^2 *(8*x-1)^3 *(6*x-1)^4 *(4*x-1)^5 *(2*x-1)^6). - Alois P. Heinz, Oct 01 2013

Extensions

a(20)-a(24) from Alois P. Heinz, Oct 01 2013

A130663 1/2048 the number of permutations of 0..n having exactly 7 maxima.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10922, 929569, 43800104, 1513315264, 42878777216, 1057229805952, 23518119959040, 483438472237056, 9338507684459520, 171607973968784640, 3027838101326610432, 51660428017842610176, 857132463549737238528
Offset: 0

Views

Author

R. H. Hardin, Aug 11 2007

Keywords

Comments

a(n) = A179710(n+1)/2048.

Crossrefs

Cf. A100575.

Formula

G.f.: -x^12* (264868724736000*x^15 -891839368396800*x^14 +1387289679298560*x^13 -1320505755697152*x^12 +859006229078016*x^11 -404049277108224*x^10 +141829511625984*x^9 -37804275799552*x^8 +7710418349056*x^7 -1202843456128*x^6 +142319143104*x^5 -12540195936*x^4 +796479552*x^3 -34424192*x^2 +905327*x -10922) / ((14*x-1) *(12*x-1)^2 *(10*x-1)^3 *(8*x-1)^4 *(6*x-1)^5 *(4*x-1)^6 *(2*x-1)^7). - Alois P. Heinz, Oct 01 2013

Extensions

a(20)-a(24) from Alois P. Heinz, Oct 01 2013

A130651 1/16 the number of permutations of 0..n having exactly 3 maxima.

Original entry on oeis.org

0, 0, 0, 0, 1, 17, 180, 1536, 11616, 81552, 545536, 3532544, 22368000, 139434240, 859634688, 5258379264, 31986270208, 193796182016, 1170829049856, 7059331547136
Offset: 0

Views

Author

R. H. Hardin, Aug 11 2007

Keywords

Crossrefs

Cf. A100575.

Formula

Conjecture: a(n) = 2^(n-8)*(3^(n+1) - 2^(n+2)*n + 2*n^2 - 3). - Vaclav Kotesovec, Nov 29 2012
Empirical g.f.: -x^4*(3*x-1) / ((2*x-1)^3*(4*x-1)^2*(6*x-1)). - Colin Barker, Dec 06 2014
Empirical: a(n) = A000487(n+1)/16. - R. J. Mathar, Mar 01 2015

A130661 1/256 the number of permutations of 0..n having exactly 5 maxima.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 31, 1382, 35396, 686044, 11204160, 163014240, 2184175040, 27534645760, 331417960960, 3848744330240, 43455499573248, 479802090507264
Offset: 0

Views

Author

R. H. Hardin, Aug 11 2007

Keywords

Crossrefs

Cf. A100575.

Formula

a(n) = A179708(n+1)/256. - R. J. Mathar, Mar 01 2015

A130672 1/2048 the number of permutations of 0..n having exactly 8 maxima.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 929569, 102473312, 6179518784, 270387409408, 9612347580288, 294906281038848, 8102569802280960, 204349178312171520, 4814058618713806080, 107303318912687001600, 2285117810799260737536, 46847474535385018662912
Offset: 0

Views

Author

R. H. Hardin, Aug 11 2007

Keywords

Crossrefs

Cf. A100575.

Formula

G.f.: -x^14*(2221337452121948160000*x^21 -9760477616069935104000*x^20 +20244234430012037529600*x^19 -26335222393830931169280*x^18 +24084924195719381778432*x^17 -16454234575958940057600*x^16 +8711075299942448234496*x^15 -3659533117443725524992*x^14 +1239282839272952659968*x^13 -341804601848828702720*x^12 +77260554496485515264*x^11 -14354015599695689728*x^10 +2191679066071605248*x^9 -274160452802404096*x^8 +27914643037454336*x^7 -2289010376895744*x^6 +148747438841728*x^5 -7477026915152*x^4 +280088417440*x^3 -7353576584*x^2 +120623248*x -929569) / ((16*x-1) *(14*x-1)^2 *(12*x-1)^3 *(10*x-1)^4 *(8*x-1)^5 *(6*x-1)^6 *(4*x-1)^7 *(2*x-1)^8). - Alois P. Heinz, Oct 01 2013

Extensions

a(21)-a(25) from Alois P. Heinz, Oct 01 2013

A383235 Triangle read by rows: T(n,k) = 2*floor(k/2)*T(n-1,k) + T(n-1,k-1), 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 4, 4, 1, 0, 0, 8, 12, 8, 1, 0, 0, 16, 32, 44, 12, 1, 0, 0, 32, 80, 208, 92, 18, 1, 0, 0, 64, 192, 912, 576, 200, 24, 1, 0, 0, 128, 448, 3840, 3216, 1776, 344, 32, 1, 0, 0, 256, 1024, 15808, 16704, 13872, 3840, 600, 40, 1
Offset: 0

Views

Author

Ven Popov, Apr 20 2025

Keywords

Comments

Row sums give A007472.
The recurrence is analogous to that of Stirling numbers of the 2nd kind (A048993), but with a parity constraint. For even columns, T(n+1, 2*k) = 2*k*T(n, 2*k) + T(n, 2*k-1); for odd columns, T(n+1, 2*k+1) = 2*k*T(n, 2*k+1) + T(n, 2*k).
T(n,k) appear as coefficients in the following polynomials (which themselves are coefficients of t^n in the bivariate e.g.f.:
P_0(x) = 1
P_1(x) = 0 + x
P_2(x) = 0 + 0 + x^2
P_3(x) = 0 + 0 + 2x^2 + x^3
P_4(x) = 0 + 0 + 4x^2 + 4x^3 + x^4
P_5(x) = 0 + 0 + 8x^2 + 12x^3 + 8x^4 + x^5
P_6(x) = 0 + 0 + 16x^2 + 32x^3 + 44x^4 + 12x^5 + x^6
P_n(1) gives A007472.
T(n,k) enumerates the number of ways to partition n labeled objects in k compartments of urns with two compartments each with the following constraints:
- you can initially place a marble in any compartment of any urn
- you cannot use the same compartment in an urn again until you've used its other compartment
- you can freely place objects in any compartment of urns where both compartments are already used
- you cannot open a new urn until both compartments of all previously used urns are filled
Examples:
For T(3,2) we have two ways to place the objects in two compartments of a single urn
- {13|2}
- {1|23}
For T(3,3) we have one way to place each object in its own compartment (2 urns, 3 compartments used):
- {1|2}{3|}
For 4 objects we have:
- 4 cases for Z(4,2):
{134|2}
{14|23}
{13|24}
{1|234}
- 4 cases for Z(4,3):
{{13|2},{4|}}
{{1|23},{4|}}
{{14|2},{3|}}
{{1|24},{3|}}
- 1 case for Z(4,4):
{{1|2}, {3|4}}
Then A007472 counts the total number of ways to partition n labeled objects in such nonempty two-compartment urns.

Examples

			The triangle T(n,k) begins:
  n\k 0 1    2     3      4       5       6      7      8     9   10 11 12
  0:  1
  1:  0 1
  2:  0 0    1
  3:  0 0    2     1
  4:  0 0    4     4      1
  5:  0 0    8    12      8       1
  6:  0 0   16    32     44      12       1
  7:  0 0   32    80    208      92      18      1
  8:  0 0   64   192    912     576     200     24      1
  9:  0 0  128   448   3840    3216    1776    344     32     1
  10: 0 0  256  1024  15808   16704   13872   3840    600    40    1
  11: 0 0  512  2304  64256   82624   99936  36912   8640   920   50  1
  12: 0 0 1024  5120 259328  394752  682240 321408 106032 16000 1420 60  1
------------------------------------------------------------------------
Recurrence:
S(5,3) = 2*Floor(3/2)*S(4,3) + S(4,2) = 2*4 + 4 = 12.
S(5,4) = 2*Floor(4/2)*S(4,4) + S(4,3) = 4*1 + 4 = 8.
		

Crossrefs

Cf. A048993. Row sums give A007472. Column T(n+2,2) gives A000079(n). Column T(n+2,3) gives A001787(n). Column T(n+2,4) gives A100575(n). Column T(n+5,5)*4 gives A158681(n). T(n+1,n) gives A007590(n).

Programs

  • Mathematica
    Z[0,0,m_]=1;
    Z[0,k_,m_]:=0/;k>0;
    Z[n_,0,m_]:=0/;n>0;
    Z[n_,k_,m_]:=Z[n,k,m]=m*Floor[k/m]*Z[n-1,k,m]+Z[n-1,k-1,m];
    Flatten[Table[Z[n,k,2],{n,0,12},{k,0,n}]]

Formula

T(n, k) = 2*Floor(k/2)*T(n-1, k) + T(n-1, k-1), n > 0; T(0, k) = 0, k > 0; T(0, 0) = 1.
E.g.f.: A[x_, t_] := x*(BesselK[0,x] + BesselK[1,x])*BesselI[0,x*Exp[t]] + x*(BesselI[1,x] - BesselI[0,x])*BesselK[0, x Exp[t]] where T(n,k) are the coefficients of x^k for t^n. The much simpler formula BesselI[0,x*Exp[t]] produces the same coefficients but with carrier alternating BesselI[0,x] and BesselI[1,x] functions at even and odd coefficients.

A130660 1/16 the number of permutations of 0..n having exactly 4 maxima.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 17, 496, 8576, 115072, 1328336, 13899904, 135927040, 1266360320, 11385790720, 99682672640, 855303553024, 7226263666688, 60329459699712, 499027284295680
Offset: 0

Views

Author

R. H. Hardin, Aug 11 2007

Keywords

Crossrefs

Cf. A100575.

Formula

a(n) = A000517(n+1)/16. - R. J. Mathar, Mar 01 2015
Showing 1-10 of 11 results. Next