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.

User: Michael A. Allen

Michael A. Allen's wiki page.

Michael A. Allen has authored 33 sequences. Here are the ten most recent ones:

A387021 Number of permutations (p(1),p(2),...,p(n)) of (1,2,...,n) such that p(i)-i is in {-2,0,7} for all i=1,...,n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 5, 7, 10, 13, 17, 21, 25, 30, 36, 46, 59, 81, 109, 153, 207, 277, 361, 463, 589, 743, 949, 1211, 1589, 2083, 2773, 3670, 4861, 6388, 8344, 10848, 14019, 18166, 23479, 30556, 39762, 52049, 68125, 89345, 117034, 153078, 199979, 260572, 339546, 441669, 575341
Offset: 0

Author

Michael A. Allen, Aug 13 2025

Keywords

Examples

			a(9)=2: 123456789, 891234567.
		

References

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

Crossrefs

Sequences for numbers of permutations such that p(i)-i is in {-2,0,d} for d=1,...,8: A000930, A006498, A080000, A224809, A387020, A224808, A387021, A224811.

Programs

  • Mathematica
    CoefficientList[Series[(1 - 3*x^9 - 2*x^11 - x^13 + 3*x^18 + 2*x^20 - x^27)/ (1 - x - 4*x^9 + 3*x^10 - 3*x^11 + 2*x^12 - 2*x^13 + x^14 - x^15 + 6*x^18 - 3*x^19 + 6*x^20 - 2*x^21 + 3*x^22 - 4*x^27 + x^28 - 3*x^29 + x^36),{x,0,55}],x]
    LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 0, 4, -3, 3, -2, 2, -1, 1, 0, 0, -6, 3, -6, 2, -3, 0, 0, 0, 0, 4, -1, 3, 0, 0, 0, 0, 0, 0, -1}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 5, 7, 10, 13, 17, 21, 25, 30, 36, 46, 59, 81, 109, 153, 207, 277, 361, 463, 589, 743, 949, 1211, 1589, 2083, 2773}, 56]

Formula

a(n) = a(n-1) + 4*a(n-9) - 3*a(n-10) + 3*a(n-11) - 2*a(n-12) + 2*a(n-13) - a(n-14) + a(n-15) - 6*a(n-18) + 3*a(n-19) - 6*a(n-20) + 2*a(n-21) - 3*a(n-22) + 4*a(n-27) - a(n-28) + 3*a(n-29) - a(n-36) for n >= 36.
G.f.: (1 - 3*x^9 - 2*x^11 - x^13 + 3*x^18 + 2*x^20 - x^27)/ (1 - x - 4*x^9 + 3*x^10 - 3*x^11 + 2*x^12 - 2*x^13 + x^14 - x^15 + 6*x^18 - 3*x^19 + 6*x^20 - 2*x^21 + 3*x^22 - 4*x^27 + x^28 - 3*x^29 + x^36).

A387020 Number of permutations (p(1),p(2),...,p(n)) of (1,2,...,n) such that p(i)-i is in {-2,0,5} for all i=1,...,n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 3, 5, 7, 10, 13, 16, 20, 25, 34, 46, 67, 94, 130, 175, 231, 305, 400, 540, 729, 999, 1363, 1855, 2510, 3370, 4531, 6070, 8180, 11026, 14921, 20197, 27322, 36940, 49820, 67204, 90528, 122091, 164686, 222344, 300316, 405574, 547768, 739291, 997794, 1346130
Offset: 0

Author

Michael A. Allen, Aug 13 2025

Keywords

Examples

			a(7) = 2: 1234567, 6712345.
a(8) = 3: 12345678, 17823456, 67123458.
		

References

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

Crossrefs

Sequences for numbers of permutations such that p(i)-i is in {-2,0,d} for d=1,..,8: A000930, A006498, A080000, A224809, A387020, A224808, A387021, A224811.

Programs

  • Mathematica
    CoefficientList[Series[(1 - 2*x^7 - x^9 + x^14)/(1 - x - 3*x^7 + 2*x^8 - 2*x^9 + x^10 - x^11 + 3*x^14 - x^15 + 2*x^16 - x^21),{x,0,51}],x]
    LinearRecurrence[{1, 0, 0, 0, 0, 0, 3, -2, 2, -1, 1, 0, 0, -3, 1, -2, 0, 0, 0, 0, 1}, {1, 1, 1, 1, 1, 1, 1, 2, 3, 5, 7, 10, 13, 16, 20, 25, 34, 46, 67, 94, 130}, 52]

Formula

a(n) = a(n-1) + 3*a(n-7) - 2*a(n-8) + 2*a(n-9) - a(n-10) + a(n-11) - 3*a(n-14) + a(n-15) - 2*a(n-16) + a(n-21) for n >= 21.
G.f.: (1 - 2*x^7 - x^9 + x^14)/((1 - x)*(1 - x + x^2 - 2*x^3 + x^4 - x^5 - x^7 + x^10)*(1 + x + x^3 + 2*x^4 + x^5 + 2*x^6 + 2*x^7 + x^8 + x^9 + x^10)).

A385870 Number of subsets of {1,2,...,n} such that no two elements differ by 1 or 6.

Original entry on oeis.org

1, 2, 3, 5, 8, 13, 21, 29, 45, 66, 99, 148, 218, 337, 497, 755, 1131, 1699, 2571, 3824, 5794, 8661, 13041, 19601, 29376, 44311, 66349, 99936, 150000, 225387, 339000, 508631, 765392, 1148865, 1727249, 2595270, 3898324, 5861084, 8801690, 13231745, 19877092, 29869125
Offset: 0

Author

Michael A. Allen, Jul 11 2025

Keywords

Comments

a(n) is the number of permutations of 0..n with each element moved by -1 to 1 places and every 6 consecutive elements having their maximum within 6 of their minimum.

Examples

			For n = 7, the 29 subsets are {}, {1}, {2}, {3}, {1,3}, {4}, {1,4}, {2,4}, {5}, {1,5}, {2,5}, {3,5}, {1,3,5}, {6}, {1,6}, {2,6}, {3,6}, {1,3,6}, {4,6}, {1,4,6}, {2,4,6}, {7}, {2,7}, {3,7}, {4,7}, {2,4,7}, {5,7}, {2,5,7}, {3,5,7}.
		

Crossrefs

Column k=33 of A376033.

Programs

  • Mathematica
    CoefficientList[Series[(1 + x + x^2 + 2*x^3 + 2*x^4 + 2*x^5 + 5*x^6 + 3*x^8 + 2*x^9 - x^10 + x^11 - 4*x^12 - x^13 - 2*x^14 - 2*x^15 - x^17)/(1 - x - x^4 - x^5 + 2*x^6 - 4*x^7 + 2*x^8 - 2*x^10 + 2*x^11 - 4*x^12 + 3*x^13 - x^14 + 2*x^16 - x^17 + x^18),{x,0,41}],x]
    LinearRecurrence[{1,0,0,1,1,-2,4,-2,0,2,-2,4,-3,1,0,-2,1,-1},{1,2,3,5,8,13,21,29,45,66,99,148,218,337,497,755,1131,1699}, 42]

Formula

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

A378005 Number of permutations (p(1),p(2),...,p(n)) of (1,2,...,n) such that p(i)-i is in {-2,4,5} for all i=1,...,n.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 1, 6, 6, 1, 0, 0, 1, 10, 20, 10, 1, 1, 1, 15, 50, 50, 15, 6, 7, 21, 105, 175, 105, 36, 42, 49, 196, 490, 490, 231, 183, 217, 392, 1176, 1764, 1246, 785, 946, 1141, 2646, 5292, 5418, 3613, 3664, 4390, 6601, 14112, 19614
Offset: 0

Author

Michael A. Allen, Nov 13 2024

Keywords

Examples

			a(6) = 1: 561234.
a(7) = 1: 6712345.
		

References

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

Crossrefs

See A376743 for other sequences related to strongly restricted permutations.

Programs

  • Mathematica
    CoefficientList[Series[1/((1-x^7-x^6-x^13/(1-x^7-x^6/(1-x^7/(1-x^3))))), {x, 0, 65}],x]

Formula

a(n) = a(n-3) + 2*a(n-6) + 3*a(n-7) - 2*a(n-9) - 2*a(n-10) - a(n-12) - 2a(n-13) - 3*a(n-14) + a(n-15) + a(n-16) + a(n-17) + a(n-21) for n >= 21.
G.f.: (1 - x)*(1 + x + x^2 - x^6 - 3*x^7 - 3*x^8 - 2*x^9 - x^10 - x^11 - x^12 - x^13)/(1 - x^3 - 2*x^6 - 3*x^7 + 2*x^9 + 2*x^10 + x^12 + 2*x^13 + 3*x^14 - x^15 - x^16 - x^17 - x^21).

A377715 Number of permutations (p(1),p(2),...,p(n)) of (1,2,...,n) such that p(i)-i is in {-2,3,4} for all i=1,...,n.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 3, 1, 0, 0, 1, 6, 6, 1, 1, 1, 10, 20, 10, 5, 6, 15, 50, 50, 25, 30, 36, 105, 175, 125, 115, 141, 231, 490, 525, 435, 541, 673, 1246, 1820, 1695, 1901, 2361, 3361, 5501, 6301, 6601, 8295, 10440, 15820, 21410, 23286
Offset: 0

Author

Michael A. Allen, Nov 04 2024

Keywords

Examples

			a(5) = 1: 45123.
a(6) = 1: 561234.
		

References

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

Crossrefs

See A376743 for other sequences related to strongly restricted permutations.

Programs

  • Mathematica
    CoefficientList[Series[(1 - x^3 - x^5 - x^6 + x^9)/(1 - x^3 - 2*x^5 - 2*x^6 + x^8 + 2*x^9 + x^10 + x^11 + x^12 - x^15),{x,0,56}],x]
    LinearRecurrence[{0, 0, 1, 0, 2, 2, 0, -1, -2, -1, -1, -1, 0, 0, 1}, {1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 3, 1, 0, 0}, 57]

Formula

a(n) = a(n-3) + 2*a(n-5) + 2*a(n-6) - a(n-8) - 2*a(n-9) - a(n-10) - a(n-11) - a(n-12) + a(n-15) for n >= 15.
G.f.: (1 - x^3 - x^5 - x^6 + x^9)/(1 - x^3 - 2*x^5 - 2*x^6 + x^8 + 2*x^9 + x^10 + x^11 + x^12 - x^15).

A376743 Number of permutations (p(1),p(2),...,p(n)) of (1,2,...,n) such that p(i)-i is in {-2,-1,4} for all i=1,...,n.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 5, 5, 6, 8, 11, 15, 25, 35, 46, 61, 85, 125, 175, 245, 341, 470, 650, 925, 1300, 1810, 2521, 3520, 4915, 6880, 9640, 13476, 18801, 26251, 36721, 51346, 71776, 100335, 140210, 195886, 273813, 382821, 535105, 747850, 1045220
Offset: 0

Author

Michael A. Allen, Oct 03 2024

Keywords

Comments

Other sequences related to strongly restricted permutations pi(i) of i in {1,..,n} along with the sets of allowed p(i)-i (containing at least 3 elements): A000045 {-1,0,1}, A189593 {-1,0,2,3,4,5,6}, A189600 {-1,0,2,3,4,5,6,7}, A006498 {-2,0,2}, A080013 {-2,1,2}, A080014 {-2,0,1,2}, A033305 {-2,-1,1,2}, A002524 {-2,-1,0,1,2}, A080000 {-2,0,3}, A080001 {-2,1,3}, A080004 {-2,0,1,3}, A080002 {-2,2,3}, A080005 {-2,0,2,3}, A080008 {-2,1,2,3}, A080011 {-2,0,1,2,3}, A079999 {-2,-1,3}, A080003 {-2,-1,0,3}, A080006 {-2,-1,1,3}, A080009 {-2,-1,0,1,3}, A080007 {-2,-1,2,3}, A080010 {-2,-1,0,2,3}, A080012 {-2,-1,1,2,3}, A072827 {-2,-1,0,1,2,3}, A224809 {-2,0,4}, A189585 {-2,0,1,3,4}, A189581 {-2,-1,0,3,4}, A072850 {-2,-1,0,1,2,3,4}, A189587 {-2,0,1,3,4,5}, A189588 {-2,-1,0,3,4,5}, A189594 {-2,0,1,3,4,5,6}, A189595 {-2,-1,0,3,4,5,6}, A189601 {-2,0,1,3,4,5,6,7}, A189602 {-2,-1,0,3,4,5,6,7}, A224811 {-2,0,8}, A224812 {-2,0,10}, A224813 {-2,0,12}, A006500 {-3,0,3}, A079981 {-3,1,3}, A079983 {-3,0,1,3}, A079982 {-3,2,3}, A079984 {-3,0,2,3}, A079988 {-3,1,2,3}, A079989 {-3,0,1,2,3}, A079986 {-3,-1,1,3}, A079992 {-3,-1,0,1,3}, A079987 {-3,-1,2,3}, A079990 {-3,-1,0,2,3}, A079993 {-3,-1,1,2,3}, A079985 {-3,-2,2,3}, A079991 {-3,-2,0,2,3}, A079996 {-3,-2,0,1,2,3}, A079994 {-3,-2,1,2,3}, A079997 {-3,-2, -1,1,2,3}, A002526 {-3,-2,-1,0,1,2,3}, A189586 {-3,0,1,2,4}, A189583 {-3,-1,0,2,4}, A189582 {-3,-2,0,1,4}, A189584 {-3,-2,-1,0,4}, A189589 {-3,0,1,2,4,5}, A189590 {-3,-1,0,2,4,5}, A189591 {-3,-2,1,4,5}, A189592 {-3,-2,-1,0,4,5}, A224810 {-3,0,6}, A189596 {-3,0,1,2,4,5,6}, A189597 {-3,-1,0,2,4,5,6}, A189598 {-3,-2,0,1,4,5,6}, A189599 {-3,-2,-1,0,4,5,6}, A224814 {-3,0,9}, A031923 {-4,0,4}, A072856 {-4,-3, -2,-1,0,1,2,3,4}, A224815 {-4,0,8}, A154654 {-5,-4,-3,-2,-1,0,1,2,3,4,5}, A154655 {-6,-5,-4,-3, -2,-1,0,1,2,3,4,5,6}.
[Keyword "less", because this comment should be moved to the Index to the OEIS, it is not appropriate here. - N. J. A. Sloane, Oct 25 2024]

References

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

Crossrefs

See comments for other sequences related to strongly restricted permutations.

Programs

  • Mathematica
    CoefficientList[Series[(1 - x^3 - x^4 - x^6 + x^9)/(1 - x^3 - x^4 - x^5 - 2*x^6 - x^7 + 2*x^9 + 2*x^10 + x^12 - x^15),{x,0,49}],x]
    LinearRecurrence[{0, 0, 1, 1, 1, 2, 1, 0, -2, -2, 0, -1, 0, 0, 1}, {1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 5, 5, 6, 8}, 50]

Formula

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

A375985 Number of subsets of {1,2,...,n} such that no two elements differ by 1, 3, 4, or 5.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 11, 14, 18, 25, 35, 49, 67, 90, 119, 158, 211, 285, 387, 526, 712, 960, 1290, 1733, 2331, 3142, 4241, 5727, 7729, 10422, 14043, 18918, 25490, 34359, 46329, 62478, 84250, 113590, 153123, 206400, 278219, 375056, 505635, 681703, 919076, 1239066
Offset: 0

Author

Michael A. Allen, Sep 21 2024

Keywords

Comments

a(n) is the number of compositions of n+5 into parts 1, 6, and 8.

Examples

			For n = 6, the 11 subsets are {}, {1}, {2}, {3}, {1,3}, {4}, {2,4}, {5}, {3,5}, {6}, {4,6}.
		

Crossrefs

Column k=29 of A376033.

Programs

  • Mathematica
    CoefficientList[Series[(1 + x + x^2 + 2*x^3 + 2*x^4 + 2*x^5 + x^6 + x^7)/(1 - x - x^6 - x^8),{x,0,43}],x]
    LinearRecurrence[{1, 0, 0, 0, 0, 1, 0, 1}, {1, 2, 3, 5, 7, 9, 11, 14}, 44]

Formula

a(n) = a(n-1) + a(n-6) + a(n-8) for n >= 8.
G.f.: (1 + x + x^2 + 2*x^3 + 2*x^4 + 2*x^5 + x^6 + x^7)/((1 + x)(1 - 2*x + 2*x^2 - 2*x^3 + 2*x^4 - 2*x^5 + x^6 - x^7)).

A375984 Number of subsets of {1,2,...,n} such that no two elements differ by 3, 4, or 5.

Original entry on oeis.org

1, 2, 4, 8, 12, 16, 20, 25, 33, 49, 77, 121, 181, 258, 356, 488, 680, 976, 1432, 2113, 3089, 4449, 6329, 8961, 12729, 18226, 26292, 38056, 55012, 79200, 113548, 162425, 232401, 333201, 478853, 689177, 991949, 1426322, 2048244, 2938696, 4215552, 6049984, 8688816
Offset: 0

Author

Michael A. Allen, Sep 21 2024

Keywords

Examples

			For n = 6, the 20 subsets are {}, {1}, {2}, {1,2}, {3}, {1,3}, {2,3}, {1,2,3}, {4}, {2,4}, {3,4}, {2,3,4}, {5}, {3,5}, {4,5}, {3,4,5}, {6}, {4,6}, {5,6}, {4,5,6}.
		

Crossrefs

Column k=28 of A376033.

Programs

  • Mathematica
    CoefficientList[Series[(1 + x + 2*x^2 + 4*x^3 + 4*x^4 + 4*x^5 + 3*x^6 + 2*x^7)/(1 - x - x^6 - x^7 - 2*x^8),{x,0,40}],x]
    LinearRecurrence[{1, 0, 0, 0, 0, 1, 1, 2}, {1, 2, 4, 8, 12, 16, 20, 25}, 41]

Formula

a(n) = a(n-1) + a(n-6) + a(n-7) + 2*a(n-8) for n >= 8.
G.f.: (1 + x + 2*x^2 + 4*x^3 + 4*x^4 + 4*x^5 + 3*x^6 + 2*x^7)/((1 + x)(1 + x^2)(1 - 2*x + x^2 + x^4 - 2*x^5)).

A375980 Number of subsets of {1,2,...,n} such that no two elements differ by 1, 2, or 5.

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 12, 17, 25, 35, 49, 71, 101, 142, 203, 290, 410, 583, 832, 1181, 1677, 2389, 3397, 4825, 6865, 9766, 13879, 19736, 28074, 39913, 56748, 80709, 114765, 163175, 232045, 329975, 469189, 667178, 948743, 1349062, 1918310, 2727839, 3878912, 5515657
Offset: 0

Author

Michael A. Allen, Sep 21 2024

Keywords

Examples

			For n = 6, the 12 subsets are {}, {1}, {2}, {3}, {4}, {1,4}, {5}, {1,5}, {2,5}, {6}, {2,6}, {3,6}.
		

Crossrefs

Column k=19 of A376033.

Programs

  • Mathematica
    CoefficientList[Series[(1 + x + x^2 + x^5)/(1 - x - x^3 + x^5 - x^6),{x,0,42}],x]
    LinearRecurrence[{1, 0, 1, 0, -1, 1}, {1, 2, 3, 4, 6, 9}, 43]

Formula

a(n) = a(n-1) + a(n-3) - a(n-5) + a(n-6) for n >= 6.
G.f.: (1 + x)*(1 + x^2 - x^3 + x^4)/(1 - x - x^3 + x^5 - x^6).

A375977 Number of subsets of {1,2,...,n} such that no two elements differ by 2 or 5.

Original entry on oeis.org

1, 2, 4, 6, 9, 15, 21, 29, 45, 69, 100, 152, 236, 349, 517, 789, 1185, 1757, 2653, 4014, 5992, 8986, 13573, 20363, 30485, 45901, 69041, 103481, 155468, 233908, 351104, 527033, 792405, 1190493, 1787129, 2685209, 4035261, 6059758, 9101828, 13676670, 20544125
Offset: 0

Author

Michael A. Allen, Sep 20 2024

Keywords

Examples

			For n = 6, the 21 subsets are {}, {1}, {2}, {1,2}, {3}, {2,3}, {4}, {1,4}, {3,4}, {5}, {1,5}, {2,5}, {1,2,5}, {4,5}, {1,4,5}, {6}, {2,6}, {3,6}, {2,3,6}, {5,6}, {2,5,6}.
		

Crossrefs

Column k=18 of A376033.

Programs

  • Mathematica
    CoefficientList[Series[(1 + x + 2*x^2 + x^3 + x^4 + 3*x^5 + x^6 - x^7 - x^10)/(1 - x - x^3 + x^5 - x^6 - 2*x^7 + x^8 - x^10 + x^11),{x,0,39}],x]
    LinearRecurrence[{1, 0, 1, 0, -1, 1, 2, -1, 0, 1, -1}, {1, 2, 4, 6, 9, 15, 21, 29, 45, 69, 100}, 39]

Formula

a(n) = a(n-1) + a(n-3) - a(n-5) + a(n-6) + 2*a(n-7) - a(n-8) + a(n-10) - a(n-11) for n >= 11.
G.f.: (1 + x + 2*x^2 + x^3 + x^4 + 3*x^5 + x^6 - x^7 - x^10)/(1 - x - x^3 + x^5 - x^6 - 2*x^7 + x^8 - x^10 + x^11).