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.

A376033 Number A(n,k) of binary words of length n avoiding distance (i+1) between "1" digits if the i-th bit is set in the binary representation of k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 3, 8, 1, 2, 4, 5, 16, 1, 2, 3, 6, 8, 32, 1, 2, 4, 4, 9, 13, 64, 1, 2, 3, 8, 6, 15, 21, 128, 1, 2, 4, 5, 12, 9, 25, 34, 256, 1, 2, 3, 6, 7, 18, 13, 40, 55, 512, 1, 2, 4, 4, 8, 11, 27, 19, 64, 89, 1024, 1, 2, 3, 8, 5, 11, 16, 45, 28, 104, 144, 2048
Offset: 0

Views

Author

Alois P. Heinz, Sep 09 2024

Keywords

Comments

Also the number of subsets of [n] avoiding distance (i+1) between elements if the i-th bit is set in the binary representation of k. A(6,3) = 13: {}, {1}, {2}, {3}, {4}, {5}, {6}, {1,4}, {1,5}, {1,6}, {2,5}, {2,6}, {3,6}.
Each column sequence satisfies a linear recurrence with constant coefficients.
The sequence of row n is periodic with period A011782(n) = ceiling(2^(n-1)).

Examples

			A(6,6) = 17: 000000, 000001, 000010, 000011, 000100, 000110, 001000, 001100, 010000, 010001, 011000, 100000, 100001, 100010, 100011, 110000, 110001 because 6 = 110_2 and no two "1" digits have distance 2 or 3.
A(6,7) = 10: 000000, 000001, 000010, 000100, 001000, 010000, 010001, 100000, 100001, 100010.
A(7,7) = 14: 0000000, 0000001, 0000010, 0000100, 0001000, 0010000, 0010001, 0100000, 0100001, 0100010, 1000000, 1000001, 1000010, 1000100.
Square array A(n,k) begins:
     1,  1,   1,  1,   1,  1,  1,  1,   1,  1, ...
     2,  2,   2,  2,   2,  2,  2,  2,   2,  2, ...
     4,  3,   4,  3,   4,  3,  4,  3,   4,  3, ...
     8,  5,   6,  4,   8,  5,  6,  4,   8,  5, ...
    16,  8,   9,  6,  12,  7,  8,  5,  16,  8, ...
    32, 13,  15,  9,  18, 11, 11,  7,  24, 11, ...
    64, 21,  25, 13,  27, 16, 17, 10,  36, 17, ...
   128, 34,  40, 19,  45, 25, 27, 14,  54, 25, ...
   256, 55,  64, 28,  75, 37, 41, 19,  81, 37, ...
   512, 89, 104, 41, 125, 57, 60, 26, 135, 57, ...
		

Crossrefs

Columns k=0-20 give: A000079, A000045(n+2), A006498(n+2), A000930(n+2), A006500, A130137, A079972(n+3), A003269(n+4), A031923(n+1), A263710(n+1), A224809(n+4), A317669(n+4), A351873, A351874, A121832(n+4), A003520(n+4), A208742, A374737, A375977, A375980, A375978.
Rows n=0-2 give: A000012, A007395(k+1), A010702(k+1).
Main diagonal gives A376091.
A(n,2^k-1) gives A141539.
A(2^n-1,2^n-1) gives A376697.
A(n,2^k) gives A209435.

Programs

  • Maple
    h:= proc(n) option remember; `if`(n=0, 1, 2^(1+ilog2(n))) end:
    b:= proc(n, k, t) option remember; `if`(n=0, 1, add(`if`(j=1 and
          Bits[And](t, k)>0, 0, b(n-1, k, irem(2*t+j, h(k)))), j=0..1))
        end:
    A:= (n, k)-> b(n, k, 0):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • PARI
    step(v,b)={vector(#v, i, my(j=(i-1)>>1); if(bittest(i-1,0), if(bitand(b,j)==0, v[1+j], 0), v[1+j] + v[1+#v/2+j]));}
    col(n,k)={my(v=vector(2^(1+logint(k,2))), r=vector(1+n)); v[1]=r[1]=1; for(i=1, n, v=step(v,k); r[1+i]=vecsum(v)); r}
    A(n,k)=if(k==0, 2^n, col(n,k)[n+1]) \\ Andrew Howroyd, Oct 03 2024

Formula

A(n,k) = A(n,k+ceiling(2^(n-1))).
A(n,ceiling(2^(n-1))-1) = n+1.
A(n,ceiling(2^(n-2))) = ceiling(3*2^(n-2)) = A098011(n+2).

A264520 T(n,k)=Number of (n+1)X(k+1) arrays of permutations of 0..(n+1)*(k+1)-1 with each element having directed index change -1,0 0,2 -1,-2 or 1,0.

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 2, 1, 3, 0, 4, 2, 9, 0, 1, 6, 4, 42, 36, 12, 0, 9, 8, 196, 228, 144, 0, 1, 12, 16, 644, 1444, 1644, 576, 46, 0, 16, 32, 2116, 8018, 18769, 10368, 2116, 0, 1, 24, 64, 6854, 44521, 169195, 186624, 65182, 8281, 177, 0, 36, 128, 22201, 258264, 1525225
Offset: 1

Views

Author

R. H. Hardin, Nov 16 2015

Keywords

Comments

Table starts
.1...1......1........2..........4............6..............9...............12
.0...0......1........2..........4............8.............16...............32
.1...3......9.......42........196..........644...........2116.............6854
.0...0.....36......228.......1444.........8018..........44521...........258264
.1..12....144.....1644......18769.......169195........1525225.........14158040
.0...0....576....10368.....186624......2856816.......43731769........696507612
.1..46...2116....65182....2007889.....50099452.....1250046736......33040712340
.0...0...8281...414414...20738916....868998834....36412654041....1611878726112
.1.177..31329..2603670..216384100..14882827790..1023636039001...75733369600339
.0...0.121801.16540506.2246191236.256959272592.29395568245824.3617985452054688

Examples

			Some solutions for n=4 k=4
..7..8..9..1..2....7..8..0..1..2....7..8..0..1..2....5..8..7..1..2
..0.13.14..3..4...10.11.14..3..4...10.11.12..3..4....0.13.14..3..4
..5..6.10.18.12....5..6.17.18..9....5..6.19.18..9...17..6.10.11..9
.20.11.22.23.24...22.23.12.13.24...20.23.24.13.14...22.21.12.23.24
.15.16.17.21.19...15.16.20.21.19...15.16.17.21.22...15.16.20.18.19
		

Crossrefs

Row 1 is A224809(n+1).
Row 2 is A000079(n-3).

Formula

Empirical for column k:
k=1: a(n) = a(n-2)
k=2: a(n) = 6*a(n-2) -11*a(n-4) +13*a(n-6) -11*a(n-8) +6*a(n-10) -a(n-12)
k=3: [order 19]
k=4: [order 84]
k=5: [order 90]
Empirical for row n:
n=1: a(n) = a(n-1) +a(n-3) -a(n-4) +a(n-5) +a(n-6) -a(n-9)
n=2: a(n) = 2*a(n-1)

A354665 Triangle read by rows, T(n,k) = T(n-1,k) + T(n-1,k-1) - T(n-2,k-1) + T(n-2,k-2) + T(n-3,k-1) - T(n-3,k-3) + delta(n,0)*delta(k,0) - delta(n,1)*delta(k,1), T(n

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 1, 1, 2, 0, 1, 2, 4, 0, 1, 1, 3, 6, 3, 3, 0, 1, 4, 9, 8, 9, 0, 1, 1, 5, 13, 17, 18, 6, 4, 0, 1, 6, 18, 30, 36, 20, 16, 0, 1, 1, 7, 24, 48, 66, 55, 40, 10, 5, 0, 1, 8, 31, 72, 114, 120, 100, 40, 25, 0, 1, 1, 9, 39, 103, 186
Offset: 0

Views

Author

Michael A. Allen, Jun 04 2022

Keywords

Comments

This is the m=2, t=3 member of a two-parameter family of triangles such that T(n,k) is the number of tilings of an (n+(t-1)*k) X 1 board using k (1,m-1;t)-combs and n-k unit square tiles. A (1,g;t)-comb is composed of a line of t unit square tiles separated from each other by gaps of width g.
T(2*j+r-2*k,k) is the coefficient of x^k in (f(j,x))^(2-r)*(f(j+1,x))^r for r=0,1, where f(n,x) is a Narayana's cows polynomial defined by f(n,x)=f(n-1,x)+x*f(n-3,x)+delta(n,0) where f(n<0,x)=0.
T(n+4-2*k,k) is the number of subsets of {1,2,...,n} of size k such that no two elements in a subset differ by 2 or 4.

Examples

			Triangle begins:
  1;
  1,   0;
  1,   0,   1;
  1,   1,   2,   0;
  1,   2,   4,   0,   1;
  1,   3,   6,   3,   3,   0;
  1,   4,   9,   8,   9,   0,   1;
  1,   5,  13,  17,  18,   6,   4,   0;
  1,   6,  18,  30,  36,  20,  16,   0,   1;
  1,   7,  24,  48,  66,  55,  40,  10,   5,   0;
  1,   8,  31,  72, 114, 120, 100,  40,  25,   0,   1;
  1,   9,  39, 103, 186, 234, 221, 135,  75,  15,   6,   0;
...
		

Crossrefs

Row sums are A011782.
Sums over k of T(n-2*k,k) are A224809.
Other members of the family of triangles: A007318 (m=1,t=2), A059259 (m=2,t=2), A350110 (m=3,t=2), A350111 (m=4,t=2), A350112 (m=5,t=2), A354666 (m=2,t=4), A354667 (m=2,t=5), A354668 (m=3,t=3).
Other triangles related to tiling using combs: A059259, A123521, A157897, A335964.

Programs

  • Mathematica
    T[n_, k_]:=If[k<0 || n
    				

Formula

T(n,0) = 1.
T(n,n) = delta(n mod 2,0).
T(n,1) = n-2 for n>1.
T(2*j-r,2*j-1) = 0 for j>0, r=0,1.
T(2*(j-1)+p,2*(j-1)) = j^p for j>0 and p=0,1,2.
T(2*(j-1)+3,2*(j-1)) = j^2*(j+1)/2 for j>0.
T(2*j+p,2*j-p) = C(j+1,2)^p for j>0 and p=0,1,2.
G.f. of row sums: (1-x)/(1-2*x).
G.f. of sums of T(n-2*k,k) over k: (1-x^3)/((1-x-x^3)*(1+x^4-x^6)).
T(n,k) = T(n-1,k) + T(n-1,k-1) for n>=2*k+1 if k>=0.

A115422 Integers n > 0 such that n XOR 20*n = 21*n.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 32, 33, 36, 48, 64, 65, 66, 67, 72, 73, 96, 97, 128, 129, 130, 131, 132, 134, 144, 146, 192, 193, 194, 195, 256, 257, 258, 259, 260, 262, 264, 265, 268, 288, 289, 292, 384, 385, 386, 387, 388, 390, 512, 513, 514, 515, 516, 518
Offset: 1

Views

Author

Paul D. Hanna, Jan 22 2006

Keywords

Comments

n is in the sequence iff 2*n is in the sequence. - Robert Israel, Nov 11 2016

Crossrefs

Cf. A003714 (Fibbinary numbers), A048715, A048718, A115423, A115424.

Programs

Formula

This sequence also seems to satisfy:
5*a(n) XOR 16*a(n) = 21*a(n);
5*a(n) XOR 17*a(n) = 20*a(n); etc.
a(A224809(n+4)) = 2^n. - Gheorghe Coserea, Nov 11 2016

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

Views

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

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

Views

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

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

Views

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).
Showing 1-7 of 7 results.