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

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

Original entry on oeis.org

1, 2, 6, 18, 46, 115, 301, 792, 2068, 5380, 14020, 36581, 95413, 248786, 648714, 1691686, 4411530, 11503991, 29998953, 78228640, 203998184, 531969064, 1387222648, 3617479225, 9433351129, 24599481138, 64148406350, 167280683834
Offset: 1

Views

Author

Vladimir Baltic, Jul 21 2002

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,2,3,5,6,-1,-1,0,-1,-1},{1,2,6,18,46,115,301,792,2068,5380},30] (* Harvey P. Dale, Aug 15 2014 *)
  • PARI
    a(n)=([0,1,0,0,0,0,0,0,0,0; 0,0,1,0,0,0,0,0,0,0; 0,0,0,1,0,0,0,0,0,0; 0,0,0,0,1,0,0,0,0,0; 0,0,0,0,0,1,0,0,0,0; 0,0,0,0,0,0,1,0,0,0; 0,0,0,0,0,0,0,1,0,0; 0,0,0,0,0,0,0,0,1,0; 0,0,0,0,0,0,0,0,0,1; -1,-1,0,-1,-1,6,5,3,2,1]^(n-1)*[1;2;6;18;46;115;301;792;2068;5380])[1,1] \\ Charles R Greathouse IV, Jul 28 2015

Formula

Recurrence: a(n) = a(n-1)+2*a(n-2)+3*a(n-3)+5*a(n-4)+6*a(n-5)-a(n-6)-a(n-7)-a(n-9)-a(n-10).
G.f.: (1-x^5-x^3-x^2)/(x^10+x^9+x^7+x^6-6*x^5-5*x^4-3*x^3-2*x^2-x+1). [Corrected by Georg Fischer, May 15 2019]

A079955 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={0,2,3}.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 2, 2, 3, 3, 5, 6, 9, 11, 15, 19, 26, 34, 46, 60, 80, 105, 140, 185, 246, 325, 431, 570, 756, 1001, 1327, 1757, 2328, 3083, 4085, 5411, 7169, 9496, 12580, 16664, 22076, 29244, 38741, 51320, 67985, 90060, 119305, 158045, 209366, 277350, 367411
Offset: 0

Views

Author

Vladimir Baltic, Feb 19 2003

Keywords

Comments

Number of compositions (ordered partitions) of n into elements of the set {2,5,6}.

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
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( 1/(1-x^2-x^5-x^6) )); // G. C. Greubel, Dec 11 2019
    
  • Maple
    seq(coeff(series(1/(1-x^2-x^5-x^6), x, n+1), x, n), n = 0..50); # G. C. Greubel, Dec 11 2019
  • Mathematica
    LinearRecurrence[{0, 1, 0, 0, 1, 1}, {1, 0, 1, 0, 1, 1}, 51] (* Jean-François Alcover, Dec 11 2019 *)
  • PARI
    a(n) = ([0,1,0,0,0,0; 0,0,1,0,0,0; 0,0,0,1,0,0; 0,0,0,0,1,0; 0,0,0,0,0,1; 1,1,0,0,1,0]^n*[1;0;1;0;1;1])[1,1] \\ Charles R Greathouse IV, Jul 28 2015
    
  • Sage
    def A079955_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( 1/(1-x^2-x^5-x^6) ).list()
    A079955_list(50) # G. C. Greubel, Dec 11 2019

Formula

a(n) = a(n-2) + a(n-5) + a(n-6).
G.f.: 1/(1 - x^2 - x^5 - x^6).

A002526 Number of permutations of length n within distance 3 of a fixed permutation.

Original entry on oeis.org

1, 1, 2, 6, 24, 78, 230, 675, 2069, 6404, 19708, 60216, 183988, 563172, 1725349, 5284109, 16177694, 49526506, 151635752, 464286962, 1421566698, 4352505527, 13326304313, 40802053896, 124926806216, 382497958000, 1171122069784, 3585709284968, 10978628154457
Offset: 0

Views

Author

Keywords

Comments

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

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.
  • 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

The 14 sequences in Kløve's Table 3 are A002526, A002527, A002529, A188379, A188491, A188492, A188493, A188494, A002528, A188495, A188496, A188497, A188498, A002526.
Cf. A002524.
Column k=3 of A306209.

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8 +2*x^9-4*x^10-2*x^11-2*x^13-x^14) )); // G. C. Greubel, Jan 22 2022
    
  • Mathematica
    CoefficientList[Series[(1-x-2x^2-2x^4+x^7+x^8)/(1-2x-2x^2-10x^4-8x^5+ 2x^6+ 16x^7+10x^8+2x^9-4x^10-2x^11-2x^13-x^14),{x,0,50}],x] (* or *) LinearRecurrence[{2,2,0,10,8,-2,-16,-10,-2,4,2,0,2,1},{1,1,2,6,24,78, 230, 675,2069,6404,19708,60216,183988,563172},51] (* Harvey P. Dale, Jun 22 2011 *)
  • PARI
    Vec((1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8+2*x^9-4*x^10-2*x^11-2*x^13-x^14)+O(x^99)) \\ Charles R Greathouse IV, Jul 16 2011
    
  • Sage
    [( (1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8 +2*x^9-4*x^10-2*x^11-2*x^13-x^14) ).series(x,n+1).list()[n] for n in (0..40)] # G. C. Greubel, Jan 22 2022

Formula

G.f.: (1-x-2*x^2-2*x^4+x^7+x^8)/(1-2*x-2*x^2-10*x^4-8*x^5+2*x^6+16*x^7+10*x^8 +2*x^9-4*x^10-2*x^11-2*x^13-x^14).
a(0)=1, a(1)=1, a(2)=2, a(3)=6, a(4)=24, a(5)=78, a(6)=230, a(7)=675, a(8)=2069, a(9)=6404, a(10)=19708, a(11)=60216, a(12)=183988, a(13)=563172, a(n) = 2*a(n-1) +2*a(n-2) +10*a(n-4) +8*a(n-5) -2*a(n-6) -16*a(n-7) -10*a(n-8) -2*a(n-9) +4*a(n-10) +2*a(n-11) +2*a(n-13) +a(n-14). - Harvey P. Dale, Jun 22 2011

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

A188491 Number of permutations p on the set [n] with the properties that abs(p(i)-i) <= 3 for all i, p(1) <= 3, and p(4) >= 2.

Original entry on oeis.org

0, 1, 2, 6, 14, 48, 152, 476, 1425, 4340, 13288, 40852, 125124, 382888, 1171612, 3587505, 10985790, 33638142, 102988410, 315318756, 965432832, 2955964296, 9050522241, 27710613432, 84843476928, 259771465608, 795361704776, 2435217884992
Offset: 0

Views

Author

N. J. A. Sloane, Apr 01 2011

Keywords

Comments

a(n) is also the permanent of the n X n matrix that has ones on its diagonal, ones on its three superdiagonals (with the exception of a single zero in the (1,4)-entry), ones on its three subdiagonals (with the exception of a single zero in the (4,1)-entry), and is zero elsewhere.
This is row 5 of Kløve's Table 3.

Programs

  • Maple
    a:= n-> (Matrix(13, (i, j)-> `if`(i=j-1, 1, `if`(i=13, [-1, -3, -3, -5, -9, -7, 3, 19, 21, 13, 3, 3, 1][j], 0)))^n. <<0, 0, 1, (0$6), 1, 2, 6, 14>>)[9, 1]: seq(a(n), n=0..30);  # Alois P. Heinz, Apr 08 2011
  • Mathematica
    a[n_] := ((Table[Which[i == j-1, 1, i == 13, {-1, -3, -3, -5, -9, -7, 3, 19, 21, 13, 3, 3, 1}[[j]], True, 0], {i, 1, 13}, {j, 1, 13}] // MatrixPower[#, n]&).{0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 6, 14})[[9]]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 17 2014, after Alois P. Heinz *)

Formula

a(n) = A002526(n-1) + A002528(n-1) + A188494(n-1). - Nathaniel Johnston, Apr 08 2011
G.f.: -x*(x^3+x^2-1)*(x^3+2*x^2+x+1) / (x^13 +3*x^12 +3*x^11 +5*x^10 +9*x^9 +7*x^8 -3*x^7 -19*x^6 -21*x^5 -13*x^4 -3*x^3 -3*x^2 -x+1).

Extensions

Name and comments edited by Nathaniel Johnston, Apr 08 2011

A188494 Number of permutations p on the set [n] with the properties that abs(p(i)-i) <= 3 for all i and p(1) <= 2.

Original entry on oeis.org

0, 1, 2, 4, 12, 42, 138, 414, 1235, 3764, 11604, 35664, 109132, 333652, 1021220, 3127709, 9578526, 29326904, 89785684, 274896606, 841682902, 2577075290, 7890425175, 24158602552, 73968049928, 226473538032, 693411153800, 2123068036904, 6500352097064
Offset: 0

Views

Author

N. J. A. Sloane, Apr 01 2011

Keywords

Comments

a(n) is also the permanent of the n X n matrix that has ones on its diagonal, ones on its three superdiagonals, ones on its three subdiagonals (with the exception of zeros in the (3,1) and (4,1)-entries), and is zero elsewhere.
This is row 8 of Kløve's Table 3.

Programs

  • Maple
    with(LinearAlgebra):
    A188494:= n-> `if`(n=0, 0, Permanent(Matrix(n, (i, j)->
                  `if`(abs(j-i)<4 and [i, j]<>[3, 1] and [i, j]<>[4, 1], 1, 0)))):
    seq(A188494(n), n=0..20);
  • Mathematica
    LinearRecurrence[{1,3,3,13,21,19,3,-7,-9,-5,-3,-3,-1},{0,1,2,4,12,42,138,414,1235,3764,11604,35664,109132},30] (* Harvey P. Dale, Dec 27 2015 *)
  • PARI
    concat(0, Vec(x*(x^6 +x^5 -x^4 -x^3 -x^2 +x +1) / (x^13 +3*x^12 +3*x^11 +5*x^10 +9*x^9 +7*x^8 -3*x^7 -19*x^6 -21*x^5 -13*x^4 -3*x^3 -3*x^2 -x +1) + O(x^100))) \\ Colin Barker, Dec 13 2014

Formula

From Nathaniel Johnston, Apr 10 2011: (Start)
a(n) = A188491(n+1) - A002528(n) - A002526(n).
a(n) = A002526(n-1) + A002527(n-1).
(End)
G.f.: x*(x^6 +x^5 -x^4 -x^3 -x^2 +x +1) / (x^13 +3*x^12 +3*x^11 +5*x^10 +9*x^9 +7*x^8 -3*x^7 -19*x^6 -21*x^5 -13*x^4 -3*x^3 -3*x^2 -x +1). - Colin Barker, Dec 13 2014

Extensions

Name and comments edited, and a(12)-a(28) from Nathaniel Johnston, Apr 10 2011
Showing 1-7 of 7 results.