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

A008305 Triangle read by rows: a(n,k) = number of permutations of [n] allowing i->i+j (mod n), j=0..k-1.

Original entry on oeis.org

1, 1, 2, 1, 2, 6, 1, 2, 9, 24, 1, 2, 13, 44, 120, 1, 2, 20, 80, 265, 720, 1, 2, 31, 144, 579, 1854, 5040, 1, 2, 49, 264, 1265, 4738, 14833, 40320, 1, 2, 78, 484, 2783, 12072, 43387, 133496, 362880, 1, 2, 125, 888, 6208, 30818, 126565, 439792, 1334961, 3628800
Offset: 1

Views

Author

Keywords

Comments

The point is, we are counting permutations of [n] = {1,2,...,n} with the restriction that i cannot move by more than k places. Hence the phrase "permutations with restricted displacements". - N. J. A. Sloane, Mar 07 2014
The triangle could have been defined as an infinite square array by setting a(n,k) = n! for k >= n.

Examples

			a(4,3) = 9 because 9 permutations of {1,2,3,4} are allowed if each i can be placed on 3 positions i+0, i+1, i+2 (mod 4): 1234, 1423, 1432, 3124, 3214, 3412, 4123, 4132, 4213.
Triangle begins:
  1,
  1, 2,
  1, 2,   6,
  1, 2,   9,  24,
  1, 2,  13,  44,  120,
  1, 2,  20,  80,  265,   720,
  1, 2,  31, 144,  579,  1854,   5040,
  1, 2,  49, 264, 1265,  4738,  14833,  40320,
  1, 2,  78, 484, 2783, 12072,  43387, 133496,  362880,
  1, 2, 125, 888, 6208, 30818, 126565, 439792, 1334961, 3628800,
  ...
		

References

  • H. Minc, Permanents, Encyc. Math. #6, 1978, p. 48

Crossrefs

Diagonals (from the right): A000142, A000166, A000179, A000183, A004307, A189389, A184965.
Diagonals (from the left): A000211 or A048162, 4*A000382 or A004306 or A000803, A000804, A000805.
a(n,ceiling(n/2)) gives A306738.

Programs

  • Maple
    with(LinearAlgebra):
    a:= (n, k)-> Permanent(Matrix(n,
                 (i, j)-> `if`(0<=j-i and j-i
    				
  • Mathematica
    a[n_, k_] := Permanent[Table[If[0 <= j-i && j-i < k || j-i < k-n, 1, 0], {i, 1,n}, {j, 1, n}]]; Table[Table[a[n, k], {k, 1, n}], {n, 1, 10}] // Flatten (* Jean-François Alcover, Mar 10 2014, after Alois P. Heinz *)

Formula

a(n,k) = per(sum(P^j, j=0..k-1)), where P is n X n, P[ i, i+1 (mod n) ]=1, 0's otherwise.
a(n,n) - a(n,n-1) = A002467(n). - Alois P. Heinz, Mar 06 2019

Extensions

Comments and more terms from Len Smiley
More terms from Vladeta Jovovic, Oct 02 2003
Edited by Alois P. Heinz, Dec 18 2010

A306595 Determinant of the circulant matrix whose first column corresponds to the binary digits of n.

Original entry on oeis.org

0, 1, 1, 0, 1, 2, 2, 0, 1, 0, 0, 3, 0, -3, 3, 0, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 0, 1, 0, 4, 0, 0, -9, 9, 0, 4, 9, 0, 8, 9, 0, 8, 5, 0, 0, 9, 0, -9, -8, 0, -5, 0, 0, 8, 5, 0, -5, 5, 0, 1, 2, 2, 3, 2, 24, 24, 4, 2, 3, 3, 32, 3, 4, 32, 5, 2, 24, 3
Offset: 0

Views

Author

Rémy Sigrist, Feb 27 2019

Keywords

Comments

This sequence is the binary variant of A177894.
From Robert Israel, Mar 05 2019: (Start)
a(n) is divisible by A000120(n).
If A070939(n) is even then n is divisible by A000120(n)*A065359(n). (End)

Examples

			For n = 13:
- the binary representation of 13 is "1101",
- the corresponding circulant matrix is:
    [1 1 0 1]
    [1 1 1 0]
    [0 1 1 1]
    [1 0 1 1]
- its determinant is -3,
- hence a(13) = -3.
		

Crossrefs

Programs

  • Maple
    a:= n-> `if`(n=1, 1, (l-> LinearAlgebra[Determinant](Matrix(nops(l),
           shape=Circulant[l[-i]$i=1..nops(l)])))(convert(n, base, 2))):
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 05 2019
  • PARI
    a(n) = my (d=if (n, binary(n), [0])); my (m=matrix(#d, #d, i,j, d[1+(i-j)%#d])); return (matdet(m))

Formula

a(A121016(n)) = 0 for any n > 0.
a(2^k) = 1 for any k >= 0.
a(A219325(n)) = A219325(n) for any n > 0.

A306853 Positive integers equal to the permanent of the circulant matrix formed by their decimal digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 261, 370, 407, 52036, 724212, 223123410
Offset: 1

Views

Author

Paolo P. Lava, Mar 13 2019

Keywords

Comments

1, 2, 3, 4, 5, 6, 7, 8, 9, 370 and 407 are also equal to the determinant of the circulant matrix formed by their decimal digits.

Examples

			     | 2 6 1 |
perm | 1 2 6 | = 2*2*2 + 6*6*6 + 1*1*1 + 1*2*6 + 6*1*2 + 2*6*1 = 261.
     | 6 1 2 |
.
     | 2 2 3 1 2 3 4 1 0 |
     | 0 2 2 3 1 2 3 4 1 |
     | 1 0 2 2 3 1 2 3 4 |
     | 4 1 0 2 2 3 1 2 3 |
perm | 3 4 1 0 2 2 3 1 2 | = 223123410
     | 2 3 4 1 0 2 2 3 1 |
     | 1 2 3 4 1 0 2 2 3 |
     | 3 1 2 3 4 1 0 2 2 |
     | 2 3 1 2 3 4 1 0 2 |
		

Crossrefs

Up to n=110 the permanent of the circulant matrix of the digits of n is equal to A101337 but from n=111 on it can differ.

Programs

  • Maple
    with(linalg): P:=proc(q) local a, b, c, d, i, j, k, n, t;
    for n from 1 to q do d:=ilog10(n)+1; a:=convert(n, base, 10); c:=[];
    for k from 1 to nops(a) do c:=[op(c), a[-k]]; od; t:=[op([]), c];
    for k from 2 to d do b:=[op([]), c[nops(c)]];
    for j from 1 to nops(c)-1 do b:=[op(b), c[j]]; od;
    c:=b; t:=[op(t), c]; od; if n=permanent(t)
    then print(n); fi; od; end: P(10^7);
  • PARI
    mpd(n) = {my(d = digits(n)); matpermanent(matrix(#d, #d, i, j, d[1+lift(Mod(j-i, #d))]));}
    isok(n) = mpd(n) == n; \\ Michel Marcus, Mar 14 2019
    
  • Python
    from sympy import Matrix
    A306853_list = []
    for n in range(1,10**6):
        s = [int(d) for d in str(n)]
        m = len(s)
        if n == Matrix(m, m, lambda i, j: s[(i-j) % m]).per():
            A306853_list.append(n) # Chai Wah Wu, Oct 18 2021

Extensions

a(15) from Vaclav Kotesovec, Aug 19 2021

A308126 Positive integers equal to the permanent of Hankel matrix formed by their decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 562, 962, 26240, 85440
Offset: 1

Views

Author

Paolo P. Lava, May 14 2019

Keywords

Examples

			     | 5 6 2 |
perm | 6 2 6 | = 5*2*5 + 6*6*2 + 2*6*6 + 2*2*2 + 6*6*5 + 5*6*6 = 562.
     | 2 6 5 |
		

Crossrefs

Programs

  • Maple
    with(linalg): P:=proc(q) local c, d, k, n, t: print(0);
    for n from 1 to q do c:=convert(n, base, 10): t:=[]:
    for k from 1 to nops(c) do t:=[op(t), 0]: od: d:=t: t:=[]:
    for k from 1 to nops(c) do t:=[op(t), d]: t[k, -k]:=1: od:
    if permanent(evalm(toeplitz(c) &* t))=n then print(n); fi:
    od: end: P(10^8);
Showing 1-4 of 4 results.