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 11-20 of 88 results. Next

A306209 Number A(n,k) of permutations of [n] within distance k of a fixed permutation; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1, 2, 6, 5, 1, 1, 1, 2, 6, 14, 8, 1, 1, 1, 2, 6, 24, 31, 13, 1, 1, 1, 2, 6, 24, 78, 73, 21, 1, 1, 1, 2, 6, 24, 120, 230, 172, 34, 1, 1, 1, 2, 6, 24, 120, 504, 675, 400, 55, 1, 1, 1, 2, 6, 24, 120, 720, 1902, 2069, 932, 89, 1, 1, 1, 2, 6, 24, 120, 720, 3720, 6902, 6404, 2177, 144, 1
Offset: 0

Views

Author

Alois P. Heinz, Jan 29 2019

Keywords

Comments

A(n,k) counts permutations p of [n] such that |p(j)-j| <= k for all j in [n].

Examples

			A(4,1) = 5: 1234, 1243, 1324, 2134, 2143.
A(5,2) = 31: 12345, 12354, 12435, 12453, 12534, 12543, 13245, 13254, 13425, 13524, 14235, 14253, 14325, 14523, 21345, 21354, 21435, 21453, 21534, 21543, 23145, 23154, 24135, 24153, 31245, 31254, 31425, 31524, 32145, 32154, 34125.
Square array A(n,k) begins:
  1,  1,   1,    1,    1,     1,     1,     1,     1, ...
  1,  1,   1,    1,    1,     1,     1,     1,     1, ...
  1,  2,   2,    2,    2,     2,     2,     2,     2, ...
  1,  3,   6,    6,    6,     6,     6,     6,     6, ...
  1,  5,  14,   24,   24,    24,    24,    24,    24, ...
  1,  8,  31,   78,  120,   120,   120,   120,   120, ...
  1, 13,  73,  230,  504,   720,   720,   720,   720, ...
  1, 21, 172,  675, 1902,  3720,  5040,  5040,  5040, ...
  1, 34, 400, 2069, 6902, 17304, 30960, 40320, 40320, ...
		

Crossrefs

Rows n=1-2 give: A000012, A040000.
Main diagonal gives A000142.
A(2n,n) gives A048163(n+1).
A(2n+1,n) gives A092552(n+1).
A(n,floor(n/2)) gives A306267.
A(n+2,n) gives A001564.
Cf. A130152.

Programs

  • Mathematica
    A[0, _] = 1;
    A[n_ /; n > 0, k_] := A[n, k] = Permanent[Table[If[Abs[i - j] <= k, 1, 0], {i, 1, n}, {j, 1, n}]];
    Table[A[n - k, k], {n, 0, 12}, {k, n, 0, -1 }] // Flatten (* Jean-François Alcover, Oct 18 2021, after Alois P. Heinz in A130152 *)

Formula

A(n,k) = Sum_{j=0..k} A130152(n,j) for n > 0, A(0,k) = 1.

A079977 Fibonacci numbers interspersed with zeros.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 3, 0, 5, 0, 8, 0, 13, 0, 21, 0, 34, 0, 55, 0, 89, 0, 144, 0, 233, 0, 377, 0, 610, 0, 987, 0, 1597, 0, 2584, 0, 4181, 0, 6765, 0, 10946, 0, 17711, 0, 28657, 0, 46368, 0, 75025, 0, 121393, 0, 196418, 0, 317811, 0, 514229, 0, 832040, 0, 1346269
Offset: 0

Views

Author

Vladimir Baltic, Feb 17 2003

Keywords

Comments

Number of permutations satisfying -k <= p(i)-i <= r and p(i)-i not in I, i=1..n, with k=1, r=3, I={0,2}.
Number of compositions of n into elements of the set {2,4}.
a(n-2) is the number of circular arrangements of the first n positive integers such that adjacent terms have absolute difference 1 or 3. - Ethan Patrick White, Jun 24 2020

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.

Crossrefs

Programs

Formula

a(n) = A000045(k+1) if n=2k, a(n)=0 otherwise.
a(n) = a(n-2) + a(n-4).
G.f.: 1/(1 - x^2 - x^4).

Extensions

Editorial note: normally the alternate zeros are omitted from sequences like this. This entry is an exception. - N. J. A. Sloane

A079962 Number of permutations satisfying -k <= p(i) - i <= r and p(i) - i not in I, i=1..n, with k=1, r=5, I={1,3}.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 9, 14, 22, 36, 58, 94, 153, 247, 399, 646, 1045, 1691, 2737, 4428, 7164, 11592, 18756, 30348, 49105, 79453, 128557, 208010, 336567, 544577, 881145, 1425722, 2306866, 3732588, 6039454, 9772042, 15811497, 25583539, 41395035
Offset: 0

Views

Author

Vladimir Baltic, Feb 19 2003

Keywords

Comments

Number of compositions (ordered partitions) of n into elements of the set {1,3,5,6}. - Mark Dols, Aug 20 2010

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.

Crossrefs

Programs

  • Magma
    [Round(Fibonacci(n+3)/4): n in [0..40]]; // G. C. Greubel, Jan 21 2022
    
  • Maple
    with(combinat,fibonacci): seq(round(fibonacci(n+3)/4),n=0..38) # Mircea Merca, Jan 04 2011
  • Mathematica
    LinearRecurrence[{1,0,1,0,1,1}, {1,1,1,2,3,5}, 41] (* G. C. Greubel, Jan 21 2022 *)
  • PARI
    a(n)=fibonacci(n+3)\/4 \\ Charles R Greathouse IV, Oct 07 2015
    
  • Sage
    [(1/4)*(fibonacci(n+3) + chebyshev_U(n,1/2) + chebyshev_U(2*n,1/2)) for n in (0..40)] # G. C. Greubel, Jan 21 2022

Formula

a(n) = a(n-1) + a(n-3) + a(n-5) + a(n-6).
G.f.: 1/((1+x+x^2)*(1-x+x^2)*(1-x-x^2)).
a(n+1)/a(n) -> golden ratio A001622. - Roger L. Bagula, Mar 13 2006
a(n) + a(n+2) + a(n+4) = Fibonacci(n+5). - Mark Dols, Aug 20 2010
a(n) = round(Fibonacci(n+3)/4). - Mircea Merca, Jan 04 2011
a(n+6) - a(n) = A000045(n+6). - Paul Curtz, Jun 29 2013
a(n) + a(n+1) + a(n+2) = A024490(n+6). - R. J. Mathar, Jun 30 2013
a(n) - a(n-1) + a(n-2) = A094686(n). - R. J. Mathar, Jun 30 2013
4*a(n) = A057078(n) + A010892(n) + A000045(n+3). - R. J. Mathar, Nov 02 2016

A154654 Number of permutations of length n within distance 5.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 3720, 17304, 76110, 329462, 1441923, 6487445, 29555588, 135025756, 615260976, 2791161792, 12618600768, 57008446080, 257708989200, 1166042944564, 5279435858788, 23908888017477, 108262665958797, 490132089640318, 2218641353956314
Offset: 0

Views

Author

Torleiv Kløve, Jan 13 2009

Keywords

Comments

a(n) equals the permanent of the n X n matrix with 1's along the eleven central diagonals and 0's everywhere else. - John M. Campbell, Jul 10 2011

Crossrefs

Column k=5 of A306209.

Formula

G.f. is a rational function f(x)/g(x) where f has degree 132 and g has degree 142.

Extensions

a(0)=1 prepended by Alois P. Heinz, Jan 28 2019

A224808 Number of permutations (p(1), p(2), ..., p(n)) satisfying -k <= p(i)-i <= r and p(i)-i not in the set I, i=1..n, with k=2, r=6, I={-1,1,2,3,4,5}.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 4, 6, 9, 12, 16, 20, 25, 35, 49, 70, 100, 140, 196, 266, 361, 494, 676, 936, 1296, 1800, 2500, 3450, 4761, 6555, 9025, 12445, 17161, 23711, 32761, 45250, 62500, 86250, 119025, 164220, 226576, 312732, 431649, 595899, 822649, 1135564, 1567504, 2163456, 2985984
Offset: 0

Views

Author

Vladimir Baltic, Apr 18 2013

Keywords

Comments

a(n) is the number of subsets of {1,2,...,n-6} without differences equal to 2, 4 or 6.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1 - x^5 - x^8)/(1 - x - x^5 + x^6 - x^7 - 2*x^8 + x^9 - x^10 + x^13 + x^16), {x, 0, 50}], x] (* G. C. Greubel, Oct 28 2017 *)
    LinearRecurrence[{1,0,0,0,1,-1,1,2,-1,1,0,0,-1,0,0,-1},{1,1,1,1,1,1,1,2,4,6,9,12,16,20,25,35},60] (* Harvey P. Dale, Dec 02 2024 *)
  • PARI
    x='x+O('x^66); Vec((1-x^5-x^8)/(1-x-x^5+x^6-x^7-2*x^8+x^9-x^10+x^13+x^16) ) \\ Joerg Arndt, Apr 19 2013

Formula

a(n) = a(n-1) + a(n-5) - a(n-6) + a(n-7) + 2*a(n-8) - a(n-9) + a(n-10) - a(n-13) + a(n-16).
G.f.: (1-x^5-x^8)/(1-x-x^5+x^6-x^7-2*x^8+x^9-x^10+x^13+x^16).
a(2*k-2) = (A003269(k))^2,
a(2*k-1) = A003269(k) * A003269(k+1)

A006500 Restricted combinations.

Original entry on oeis.org

1, 2, 4, 8, 12, 18, 27, 45, 75, 125, 200, 320, 512, 832, 1352, 2197, 3549, 5733, 9261, 14994, 24276, 39304, 63580, 102850, 166375, 269225, 435655, 704969, 1140624, 1845504, 2985984, 4831488, 7817616, 12649337, 20466953, 33116057, 53582633
Offset: 0

Views

Author

Keywords

Comments

a(n)=( A000045(k+2) )^3 if n=3k, a(n)=( A000045(k+2) )^3 * A000045(k+3) if n=3k+1, a(n)= A000045(k+2) * ( A000045(k+3) )^2 if n=3k+2. Number of all subsets of the set {1,2,...,n} which do not contain two elements whose difference is 3. a(n) is number of compositions of n+3 into elements of the set {1,2,4,5,6}, but with condition that 2 succeed only 2 or 4. Number of all permutations of {1,2,...,n+3} satisfying p(i)-i in {-3,0,3}. - Vladimir Baltic, Feb 17 2003

Examples

			For example, a_4=12 and 12 subsets are: emptyset, {1}, {2}, {3}, {4}, {1,2}, {1,3}, {2,3}, {2,4}, {3,4}, {1,2,3}, {2,3,4}. Corresponding compositions of 7=4+3 are: 1+1+1+1+1+1+1+1, 4+1+1+1, 1+4+1+1, 1+1+4+1, 1+1+1+4, 5+1+1, 4+2+1, 1+5+1, 1+4+2, 1+1+5, 6+1 and 1+6.
		

References

  • M. El-Mikkawy, T. Sogabe, A new family of k-Fibonacci numbers, Appl. Math. Comput. 215 (2010) 4456-4461 doi:10.1016/j.amc.2009.12.069, Table 1 k=3.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    A006500:=-(2*z**6+z**7-z**4+z**5-3*z**3-z**2-z-1)/(z**6-z**3-1)/(z**2+z-1); # Conjectured by Simon Plouffe in his 1992 dissertation.
  • Mathematica
    Table[Fibonacci[Floor[n/3] + 3]^Mod[n, 3] * Fibonacci[Floor[n/3] + 2]^(3 - Mod[n, 3]), {n, 0, 40}]  (* David Nacin, Feb 29 2012 *)
    Table[Product[Fibonacci[Floor[(n + i)/3] + 2], {i, 0, 2}], {n, 0, 30}] (* David Nacin, Mar 07 2012 *)
    LinearRecurrence[{1, 1, -1, 1, 1, 1, -1, -1}, {1, 2, 4, 8, 12, 18, 27, 45}, 40] (* David Nacin, Mar 07 2012 *)
  • Python
    def a(n, adict={0:1, 1:2, 2:4, 3:8, 4:12, 5:18, 6:27, 7:45}):
        if n in adict:
            return adict[n]
        adict[n]=a(n-1)+a(n-2)-a(n-3)+a(n-4)+a(n-5)+a(n-6)-a(n-7)-a(n-8)
        return adict[n] # David Nacin, Mar 07 2012

Formula

Recurrence: a(n) = a(n-1)+a(n-2)-a(n-3)+a(n-4)+a(n-5)+a(n-6)-a(n-7)-a(n-8) G.f.: -(x^7+2*x^6+x^5-x^4-3*x^3-x^2-x-1)/(x^8+x^7-x^6-x^5-x^4+x^3-x^2-x+1). - Vladimir Baltic, Feb 17 2003
a(n) = F(floor(n/3) + 3)^(n mod 3)*F(floor(n/3) + 2)^(3 - (n mod 3)) where F(n) is the n-th Fibonacci number. - David Nacin, Feb 29 2012

A224809 Number of permutations (p(1), p(2), ..., p(n)) satisfying -k <= p(i)-i <= r and p(i)-i not in the set I, i=1..n, with k=2, r=4, I={-1,1,2,3}.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 4, 6, 9, 12, 16, 24, 36, 54, 81, 117, 169, 247, 361, 532, 784, 1148, 1681, 2460, 3600, 5280, 7744, 11352, 16641, 24381, 35721, 52353, 76729, 112462, 164836, 241570, 354025, 518840, 760384, 1114416, 1633284
Offset: 0

Views

Author

Vladimir Baltic, May 16 2013

Keywords

Comments

Number of subsets of {1,2,...,n-4} without differences equal to 2 or 4.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-(x-1)*(1+x+x^2)/((x^3+x-1)*(x^6-x^4-1)), {x, 0, 50}], x] (* G. C. Greubel, Apr 28 2017 *)
  • PARI
    N = 42; x = 'x + O('x^N);
    Vec(Ser(-(x-1)*(1+x+x^2)/((x^3+x-1)*(x^6-x^4-1))))  \\ Gheorghe Coserea, Nov 11 2016

Formula

a(n) = a(n-1) + a(n-3) - a(n-4) + a(n-5) + a(n-6) - a(n-9).
G.f.: -(x-1)*(1+x+x^2) / ( (x^3+x-1)*(x^6-x^4-1) ).
a(2*k) = (A000930(k))^2, a(2*k+1) = A000930(k) * A000930(k+1).

A079997 Number of permutations satisfying -k<=p(i)-i<=r and p(i)-i not in I, i=1..n, with k=3, r=3, I={0}.

Original entry on oeis.org

1, 0, 1, 2, 9, 24, 57, 140, 376, 1016, 2692, 7020, 18369, 48344, 127465, 335510, 882081, 2319136, 6100393, 16049440, 42220168, 111053856, 292109320, 768373144, 2021186393, 5316647448, 13985104873, 36786882378, 96765680857, 254536684328
Offset: 0

Views

Author

Vladimir Baltic, Feb 17 2003

Keywords

References

  • D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,3,0,6,10,0,-12,-10,-2,0,0,-1,1,1},{1,0,1,2,9,24,57,140,376,1016,2692,7020,18369,48344},40] (* Harvey P. Dale, Nov 27 2013 *)

Formula

a(n) = a(n-1)+3*a(n-2)+6*a(n-4)+10*a(n-5)-12*a(n-7)-10*a(n-8)-2*a(n-9)-a(n-12)+a(n-13)+a(n-14)
G.f.: -(x^8+x^7-x^5-2*x^4+x^3-2*x^2-x+1)/(x^14 +x^13 -x^12 -2*x^9 -10*x^8 -12*x^7 +10*x^5 +6*x^4 +3*x^2 +x-1).

A188958 T(n,k)=Number of nXk array permutations with each element moved no more than a city block distance of two.

Original entry on oeis.org

1, 2, 2, 6, 24, 6, 14, 362, 362, 14, 31, 3969, 29172, 3969, 31, 73, 45288, 1722256, 1722256, 45288, 73, 172, 532224, 104735558, 504690017, 104735558, 532224, 172, 400, 6187928, 6513224285, 151700751624, 151700751624, 6513224285, 6187928, 400
Offset: 1

Views

Author

R. H. Hardin Apr 14 2011

Keywords

Comments

Table starts
....1.........2..............6................14.................31
....2........24............362..............3969..............45288
....6.......362..........29172...........1722256..........104735558
...14......3969........1722256.........504690017.......151700751624
...31.....45288......104735558......151700751624....229188213745576
...73....532224.....6513224285....47085945014364.359214228037483580
..172...6187928...402549615544.14529766291673016
..400..71851073.24857280209008
..932.835579642
.2177

Examples

			Some solutions for 5X3
..0..3..1....0..3..1....0..3..1....0..3..1....0..3..1....0..3..1....0..3..1
..5..2.11....5..2..4....5..2..4....5..6..2....5..2..7....5..6..8....5..2.11
..4..7..8....7..9.10....6..8.14....9.13..8....4.11..8....4.13..2....4..8..7
.10.13.14....6..8.11...11..7..9....7..4.14....6.12.14...11.14..7....6.12.10
..6..9.12...12.14.13...10.13.12...12.10.11...10..9.13...10..9.12...14..9.13
		

Crossrefs

Column 1 is A002524

A072852 Number of permutations satisfying i-2<=p(i)<=i+5, i=1..n.

Original entry on oeis.org

1, 2, 6, 18, 54, 162, 454, 1267, 3613, 10344, 29572, 84436, 240868, 686884, 1959636, 5592181, 15957717, 45533682, 129922090, 370708166, 1057755082, 3018154342, 8611878218, 24572725639, 70114579881, 200061418144, 570845362600
Offset: 1

Views

Author

Vladimir Baltic, Jul 25 2002

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-(x^14+x^12+x^10+x^8-6x^7-x^6-4x^5-3x^4-2x^3-x^2+1)/(x^21+x^20+ x^17+x^16- 10x^14-10x^13-4x^12-6x^10- 6x^9-4x^8+28x^7+22x^6+ 13x^5+7x^4+4x^3+ 2x^2+x-1),{x,0,30}],x] (* or *) LinearRecurrence[{1,2,4,7,13,22,28,-4,-6,-6,0,-4,-10,-10,0,1,1,0,0,1,1},{1,1,2,6,18,54,162,454,1267,3613,10344,29572,84436,240868,686884,1959636,5592181,15957717,45533682,129922090,370708166},30] (* Harvey P. Dale, Jul 28 2024 *)

Formula

Recurrence: a(n) = a(n - 1) + 2*a(n - 2) + 4*a(n - 3) + 7*a(n - 4) + 13*a(n - 5) + 22*a(n - 6) + 28*a(n - 7) - 4*a(n - 8) - 6*a(n - 9) - 6*a(n - 10) - 4*a(n - 12) - 10*a(n - 13) - 10*a(n - 14) + a(n - 16) + a(n - 17) + a(n - 20) + a(n - 21). G.f.: - (x^14 + x^12 + x^10 + x^8 - 6*x^7 - x^6 - 4*x^5 - 3*x^4 - 2*x^3 - x^2 + 1)/(x^21 + x^20 + x^17 + x^16 - 10*x^14 - 10*x^13 - 4*x^12 - 6*x^10 - 6*x^9 - 4*x^8 + 28*x^7 + 22*x^6 + 13*x^5 + 7*x^4 + 4*x^3 + 2*x^2 + x - 1);
Previous Showing 11-20 of 88 results. Next