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.

Previous Showing 61-70 of 73 results. Next

A142703 a(n) = 2*(n-1)*( a(n-1)+a(n-2) ) starting a(1)=a(2)=1.

Original entry on oeis.org

1, 1, 8, 54, 496, 5500, 71952, 1084328, 18500480, 352526544, 7420540480, 171007474528, 4282272360192, 115785275702720, 3361891345761536, 104330298643927680, 3446150079670054912, 120716332862675408128
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 24 2008

Keywords

Crossrefs

Programs

  • Maple
    A142703 := proc(n) if n <=2 then 1 ; else 2*(n-1)*( procname(n-1)+procname(n-2)) ; end if; end proc: # R. J. Mathar, May 26 2011
  • Mathematica
    Clear[a, b, n, k] k = 2; b[0] = 0; b[n_] := b[n] = b[n - 1] + k; a[0] = 1; a[1] = 1; a[n_] := a[n] = b[n]*(a[n - 1] + a[n - 2]); Table[a[n], {n, 0, 20}]

A142704 A generalized factorial level recursion of a Padovan type: a(n) = b(n)*(a(n-2) + a(n-3)) with b(n) = b(n-1) + k and k=2.

Original entry on oeis.org

0, 1, 1, 6, 16, 70, 264, 1204, 5344, 26424, 130960, 698896, 3777216, 21576256, 125331136, 760604160, 4701036544, 30121800064, 196619065344, 1323267791104, 9069634616320, 63835247970816, 457287705926656
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Sep 24 2008

Keywords

Crossrefs

Cf. A171386 (k=0), A108189 (k=1), A002467 (Game of Mousetrap), A000931 (Padovan).

Programs

  • Maple
    A142704 := proc(n) option remember: if n=0 then 0 elif n=1 then 1 elif n =2 then 1 elif n>=3 then 2*n*(procname(n-2) + procname(n-3)) fi: end: seq(A142704(n), n=0..22); # Johannes W. Meijer, Jul 27 2011
  • Mathematica
    Clear[a, b, n, k]; k = 2; b[0] = 0; b[n_] := b[n] = b[n - 1] + k; a[0] = 0; a[1] = 1; a[2] = 2; a[n_] := a[n] = b[n]*(a[n - 2] + a[n - 3]); Table[a[n], {n, 0, 22}]
    FullSimplify[CoefficientList[Series[Pi/(4*Sqrt[2])*E^(x^2/2)*x *Sqrt[1+x] *(BesselI[-1/4,1/2*(1+x)^2]*(2*BesselI[-3/4,1/2] - BesselI[1/4,1/2]) + BesselI[1/4,1/2*(1+x)^2]*(BesselI[-1/4,1/2] - 2*BesselI[3/4,1/2])), {x, 0, 20}], x]* Range[0, 20]!] (* Vaclav Kotesovec, Dec 28 2012 *)

Formula

a(n) = b(n)*(a(n-2) + a(n-3)) with b(n) = b(n-1) + k and k = 2.
a(n) = 2*n*(a(n-2) + a(n-3)) with a(0) = 0, a(1) = a(2) = 1. - Johannes W. Meijer, Jul 27 2011
From Vaclav Kotesovec, Dec 28 2012: (Start)
E.g.f.: (Pi/(4*sqrt(2)))*exp(x^2/2)*x*sqrt(1+x)*(BesselI(-1/4,1/2*(1+x)^2)*(2*BesselI(-3/4,1/2)-BesselI(1/4,1/2))+BesselI(1/4,1/2*(1+x)^2)*(BesselI(-1/4,1/2)-2*BesselI(3/4,1/2))).
a(n) ~ (sqrt(Pi)/8) * (2*BesselI(-3/4,1/2) - 2*BesselI(3/4,1/2) + BesselI(-1/4,1/2) - BesselI(1/4,1/2)) * 2^(n/2-1/4)*exp(sqrt(n)/sqrt(2)-n/2+3/8)*n^(n/2+1/4) * (1-47/(48*sqrt(2*n))). (End)

Extensions

Edited and information added by Johannes W. Meijer, Jul 27 2011

A161129 Triangle read by rows: T(n,k) is the number of non-derangements of {1,2,...,n} for which the difference between the largest and smallest fixed points is k (n>=1; 0 <= k <= n-1).

Original entry on oeis.org

1, 0, 1, 3, 0, 1, 8, 3, 2, 2, 45, 8, 9, 8, 6, 264, 45, 44, 42, 36, 24, 1855, 264, 265, 256, 234, 192, 120, 14832, 1855, 1854, 1810, 1704, 1512, 1200, 720, 133497, 14832, 14833, 14568, 13950, 12864, 11160, 8640, 5040, 1334960, 133497, 133496, 131642, 127404
Offset: 1

Views

Author

Emeric Deutsch, Jul 18 2009

Keywords

Comments

Row sums give the number of non-derangement permutations of {1,2,...,n} (A002467).
T(n,0) = A000240(n) = number of permutations of {1,2,...,n} with exactly 1 fixed point.
T(n,1) = A000240(n-1).
T(n,2) = A000166(n-1) (the derangement numbers).
T(n,3) = A018934(n-1).
Sum_{k=0..n-1} k*T(n,k) = A161130(n).

Examples

			T(4,1)=3 because we have 1243, 4231, and 2134; T(4,2)=2 because we have 1432 and 3214; T(5,4)=6 because we have 1xyz5 where xyz is any permutation of 234.
Triangle starts:
    1;
    0,  1;
    3,  0,  1;
    8,  3,  0,  1;
   45,  8,  9,  8,  6;
  264, 45, 44, 42, 36, 24;
		

Crossrefs

Programs

  • Maple
    d[0] := 1: for n to 15 do d[n] := n*d[n-1]+(-1)^n end do: T := proc (n, k) if k = 0 then n*d[n-1] elif k < n then (n-k)*(sum(binomial(k-1, j)*d[n-2-j], j = 0 .. k-1)) else 0 end if end proc: for n to 10 do seq(T(n, k), k = 0 .. n-1) end do; # yields sequence in triangular form
  • Mathematica
    d = Subfactorial;
    T[n_, 0] := n*d[n - 1];
    T[n_, k_] := (n - k)*Sum[d[n - j - 2]*Binomial[k - 1, j], {j, 0, k - 1}];
    Table[T[n, k], {n, 1, 10}, {k, 0, n - 1}] // Flatten (* Jean-François Alcover, Nov 28 2017 *)

Formula

T(n,0) = n*d(n-1); T(n,k) = (n-k)*Sum_{j=0..k-1}d(n-2-j)*binomial(k-1,j) for 1 <= k <= n-1, where d(i)=A000166(i) are the derangement numbers.

A193364 Number of permutations that have a fixed point and contain 123.

Original entry on oeis.org

0, 0, 0, 1, 1, 3, 11, 59, 369, 2665, 21823, 199983, 2028701, 22577141, 273551115, 3585133147, 50540288857, 762641865009, 12265883397719, 209475278413895, 3785852926650453, 72191462591370733, 1448516763956727331, 30507960955933725171, 672958104387944656145
Offset: 0

Views

Author

Jon Perry, Dec 20 2012

Keywords

Comments

A000142(n-2) gives number of permutations with a 123 present.
It appears that a(n) = A180191(n-2) - A018934(n-3) for n>3.

Examples

			For n=5 we have 12345, 12354 and 41235, so a(5)=3.
For n=6 we have 123456, 123465, 123546, 123465, 123645, 123654, 412356, 451236, 512346, 541236 and 612354, so a(6)=11.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n<7, [0$3, 1$2, 3, 11][n+1],
           ((4*n^3-42*n^2+92*n+39) *a(n-1)
            +(32*n^3-2*n^4-163*n^2+223*n+204) *a(n-2)
            -(n-4)*(n-7)*(2*n^2-10*n-15) *a(n-3)) / (2*n^2-14*n-3))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Jan 07 2013
  • Mathematica
    a[n_] := a[n] = If[n<7, {0, 0, 0, 1, 1, 3, 11}[[n+1]], ((4n^3 - 42n^2 + 92n + 39) a[n-1] + (32n^3 - 2n^4 - 163n^2 + 223n + 204) a[n-2] - (n-4)(n-7) (2n^2 - 10n - 15) a[n-3])/(2n^2 - 14n - 3)];
    a /@ Range[0, 30] (* Jean-François Alcover, Mar 15 2021, after Alois P. Heinz *)

A209256 Number of permutations of [n] that contain at least two fixed points in a succession.

Original entry on oeis.org

0, 0, 1, 1, 4, 18, 93, 579, 4165, 34031, 311528, 3158978, 35154907, 426029455, 5585287179, 78767551059, 1189090451364, 19133023344034, 326894939779865, 5910529926220115, 112753567098061553, 2263304875358959543, 47687055915645538384, 1052290471481700378570
Offset: 0

Views

Author

Jon Perry, Jan 14 2013

Keywords

Comments

A succession of a permutation p is the appearance of [k,k+1], e.g. in 23541, 23 is a succession.

Examples

			For n=4 we have 1234, 1243, 4231 and 2134 so a(4) = 4.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<6, [0, 0, 1, 1, 4, 18][n+1],
          ((2*n^3-43-17*n^2+47*n) *a(n-1)
           -(n-2)*(n^3-13*n^2+50*n-59) *a(n-2)
           -(n-3)*(3*n^3-28*n^2+82*n-78) *a(n-3)
           +(-219*n^2-4*n^4+49*n^3-305+425*n) *a(n-4)
           -(n-4)*(3*n^3-25*n^2+66*n-57) *a(n-5)
           -(n-4)*(n-5)*(n-2)^2 *a(n-6)) / (n-3)^2)
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, Jan 15 2013
  • Mathematica
    a[n_] := a[n] = If[n<6, {0, 0, 1, 1, 4, 18}[[n+1]],
         ((2n^3 - 43 - 17n^2 + 47n) a[n-1]
         -(n-2)(n^3 - 13n^2 + 50n - 59) a[n-2]
         -(n-3)(3n^3 - 28n^2 + 82n - 78) a[n-3]
         +(-219n^2 - 4n^4 + 49n^3 - 305 + 425n) a[n-4]
         -(n-4)(3n^3 - 25n^2 + 66n - 57) a[n-5]
         -(n-4)(n-5)(n-2)^2 a[n-6])/(n-3)^2];
    a /@ Range[0, 25] (* Jean-François Alcover, Mar 15 2021, after Alois P. Heinz *)

Formula

a(n) ~ (n-1)! * (1 - 3/(2*n) + 2/(3*n^2) + 47/(24*n^3) - 49/(120*n^4) - 6421/(720*n^5) - 17183/(1260*n^6)). - Vaclav Kotesovec, Mar 17 2015

Extensions

Extended beyond a(10) by Alois P. Heinz, Jan 15 2013

A212650 Number of permutations of n elements with at least one fixed point and at least one 2-cycle (transposition).

Original entry on oeis.org

0, 0, 0, 3, 6, 25, 180, 1281, 10010, 90063, 902790, 9929755, 119134224, 1548768585, 21683033372, 325245031125, 5203916869710, 88466595897631, 1592398778725710, 30255576613653483, 605111531456405960, 12707342164389159945, 279561527629906821684
Offset: 0

Views

Author

Geoffrey Critzer, Feb 14 2013

Keywords

Examples

			a(3) = 3: 132, 213, 321.
a(4) = 6: 1243, 1324, 1432, 2134, 3214, 4231.
		

Crossrefs

Cf. A002467.

Programs

  • Mathematica
    nn=22;Range[0,nn]!CoefficientList[Series[(Exp[x]-1)(Exp[x^2/2]-1)Exp[-x-x^2/2]/(1-x),{x,0,nn}],x]

Formula

E.g.f.: (exp(x)-1)*(exp(x^2/2)-1)*exp(-x - x^2/2)/(1-x).
a(n) ~ n! * (exp(1)-1)*(exp(1/2)-1)*exp(-3/2) = n! * 0.248720059264354... - Vaclav Kotesovec, Aug 07 2013

A340789 a(n) = (n!)^2 * Sum_{k=1..n} (-1)^(k+1) / (k!)^2.

Original entry on oeis.org

0, 1, 3, 28, 447, 11176, 402335, 19714416, 1261722623, 102199532464, 10219953246399, 1236614342814280, 178072465365256319, 30094246646728317912, 5898472342758750310751, 1327156277120718819918976, 339752006942904017899257855, 98188330006499261172885520096
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 23 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[n!^2 Sum[(-1)^(k + 1)/k!^2, {k, 1, n}], {n, 0, 17}]
    nmax = 17; CoefficientList[Series[(1 - BesselJ[0, 2 Sqrt[x]])/(1 - x), {x, 0, nmax}], x] Range[0, nmax]!^2

Formula

Sum_{n>=0} a(n) * x^n / (n!)^2 = (1 - BesselJ(0,2*sqrt(x))) / (1 - x).
a(0) = 0; a(n) = n^2 * a(n-1) - (-1)^n.

A352650 Triangle read by rows: T(n,k) = n * T(n-1,k) + (-1)^(n-k) for 0 <= k <= n with initial values T(n,k) = 0 if n < 0 or k < 0 or k > n.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 4, 2, 1, 9, 15, 9, 3, 1, 44, 76, 44, 16, 4, 1, 265, 455, 265, 95, 25, 5, 1, 1854, 3186, 1854, 666, 174, 36, 6, 1, 14833, 25487, 14833, 5327, 1393, 287, 49, 7, 1, 133496, 229384, 133496, 47944, 12536, 2584, 440, 64, 8, 1, 1334961, 2293839, 1334961, 479439, 125361, 25839, 4401, 639, 81, 9, 1
Offset: 0

Views

Author

Werner Schulte, Apr 04 2022

Keywords

Comments

Conjecture 1: T(n,k) = Sum_{i=0..n-k} (-1)^(n+k+i) * A326326(n-k,i) * n^i for 0 <= k <= n.
Conjecture 2: T(n,k) = T(n-k,0) + Sum_{i=1..n-k} T(n-k,i) * T(i+k,k) * k / (i + k - 1) for 0 < k <= n.

Examples

			The triangle T(n,k) for 0 <= k <= n starts:
n\k :       0       1       2      3      4     5    6   7  8  9
================================================================
  0 :       1
  1 :       0       1
  2 :       1       1       1
  3 :       2       4       2      1
  4 :       9      15       9      3      1
  5 :      44      76      44     16      4     1
  6 :     265     455     265     95     25     5    1
  7 :    1854    3186    1854    666    174    36    6   1
  8 :   14833   25487   14833   5327   1393   287   49   7  1
  9 :  133496  229384  133496  47944  12536  2584  440  64  8  1
  etc.
		

Crossrefs

Cf. A000166 (column 0 and 2), A002467 (column 1), A006347 (column 3), A006348 (column 4), A009179 (row sums, signed), A352988 (matrix inverse).

Programs

  • Maple
    T := proc(n,k) option remember;
    if k > n then 0 else n * T(n-1,k) + (-1)^(n-k) fi end:
    for n from 0 to 9 do seq(T(n, k), k = 0..n) od; # Peter Luschny, Apr 11 2022

Formula

T(n,n) = 1 for n >= 0.
T(n,n-1) = n - 1 for n > 0.
T(n,n-2) = (n - 1)^2 for n > 1.
T(n,0) = A000166(n) for n >= 0.
T(n,1) = A002467(n) for n > 0.
T(n,2) = A000166(n) for n > 1.
T(n,k) + T(n,k+1) = (n!) / (k!) for 0 <= k <= n.
T(n,k) = (n - 1) * (T(n-1,k) + T(n-2,k)) for 0 <= k < n-1.
T(n,k) = (T(n,k-2) - (k - 2) * T(n,k-1)) / (k - 1) for 1 < k <= n.
The row polynomials p(n,x) = Sum_{k=0..n} T(n,k) * x^k satisfy recurrence equation p(n,x) = (n - 1) * (p(n-1,x) + p(n-2,x)) + x^n for n > 0 with initial value p(0,x) = 1.
Row sums are p(n,1) = abs(A009179(n)) for n >= 0.
Alternating row sums are p(n,-1) = (-1)^n for n >= 0.
T(n,k) * T(n+1,k+1) - T(n+1,k) * T(n,k+1) = (-1)^(n-k) * A094587(n,k) for 0 <= k <= n.
Define 3x3-matrices T(i,j) with n <= i <= n+2 and k <= j <= k+2. Then we have: det(T(i,j)) = 0^(n-k) for 0 <= k <= n.
E.g.f. of column k >= 0: Sum_{n>=k} T(n,k) * t^n / (n!) = (Sum_{n>=k} (-t)^n / (n!)) * (-1)^k / (1 - t).
E.g.f.: Sum_{n>=0, k=0..n} T(n,k) * x^k * t^n / (n!) = (x * exp(x * t) + exp(-t)) / ((1 + x) * (1 - t)).
p(n,x) = Sum_{k=0..n} ((n!)/(k!))*(x^(k+1) + (-1)^k)/(x + 1) for n >= 0.
T(n,k) = Sum_{i=0..n-k} (-1)^i * (n!) / ((k+i)!) for 0 <= k <= n.
T(n,k) equals matrix product of A094587 and A097807.

A378907 Number of permutations of [n] with at least one hit on both main diagonals.

Original entry on oeis.org

0, 1, 0, 2, 10, 48, 270, 2004, 15406, 144656, 1399070, 15924940, 185817038, 2485431096, 33966603790, 522088434644, 8178526719550, 142034596036896, 2508925152633918, 48582127821078684, 955299461042098222, 20406401587894276040, 442067447198146300718
Offset: 0

Views

Author

Vikram Saraph, Dec 10 2024

Keywords

Comments

For a permutation P, a hit on the leading diagonal is a fixed point P(i) = i and a hit on the opposite diagonal is a reverse P(i) = n+1 - i; and here P must have one or more of each.
Equivalently, a(n) is the number of ways to place n marks on an n X n grid so that there is at least one mark in every row and column and also in both of the main diagonals.

Examples

			For n = 3, the a(3) = 2 solutions are:
  X . .   . . X
  . X .   . X .
  . . X   X . .
For n = 4, one of a(4) = 10 solutions is:
  X . . .
  . . X .
  . X . .
  . . . X
All a(4) = 10 permutations of 1..4 counted are: 1324, 1342, 1423, 2314, 2431, 3124, 3241, 4132, 4213, 4231.
		

Crossrefs

Programs

Formula

a(n) = A000142(n) - 2*A000166(n) + A003471(n).

A130045 Denominator of polynomial a[1]=1, a[2]->1+1/(x*a[1]), a[3]->1+1/(2*x*a[2]), a[4]->1+1/(3*x*a[3]),.. giving 1,(1+x)/x,(3+2*x)/(2*(1+x)),(2+11*x+6*x^2)/(3*x*(3+2*x)), .. at x-> -1. Absolute values are equal to A067078(n)/n.

Original entry on oeis.org

1, 1, 4, -9, -20, 55, 210, -1085, -7000, 53235, 462350, -4500265, -48454980, 571411295, 7321388410, -101249656725, -1502852293040, 23827244817355, 401839065437670, -7182224591785985, -135607710526966300, 2696935204638786615, 56349204870460046930, -1234002202313888987245
Offset: 1

Views

Author

Wouter Meeussen, May 02 2007

Keywords

Comments

The iterated form (see Mathematica line) links some seemingly disparate sequences.

Crossrefs

Programs

  • Mathematica
    Denominator[Together[k=1;NestList[1+1/((k++)x #)&,x,24]]]/.x->(-1)

Formula

A067078 has recurrence a(1) = 1, a(2) = 2, a(n) = (n-1)*a(n-1) - (n-2)*a(n-2).
abs(a(n))=(n-1)*sum(k!,k=0..n-3)+(n-1), n>1. [From Gary Detlefs, Feb 05 2011]
Previous Showing 61-70 of 73 results. Next