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

A052182 Determinant of n X n matrix whose rows are cyclic permutations of 1..n.

Original entry on oeis.org

1, -3, 18, -160, 1875, -27216, 470596, -9437184, 215233605, -5500000000, 155624547606, -4829554409472, 163086595857367, -5952860799406080, 233543408203125000, -9799832789158199296, 437950726881001816329, -20766159817517617053696, 1041273502979112415328410
Offset: 1

Views

Author

Henry M. Gunn High School Mathematical Circle (Joshua Zucker), Jan 26 2000

Keywords

Comments

Each row is a cyclic shift to the right by one place of the previous row. See the example below. - N. J. A. Sloane, Jan 07 2019
|a(n)| = number of labeled mappings from n points to themselves (endofunctions) with an odd number of cycles. - Vladeta Jovovic, Mar 30 2006
|a(n)| = number of functions from {1,2,...,n}->{1,2,...,n} such that of all recurrent elements the least is always mapped to the greatest. - Geoffrey Critzer, Aug 29 2013

Examples

			a(3) = 18 because this is the determinant of [(1,2,3), (3,1,2), (2,3,1) ].
		

Crossrefs

Programs

  • Maple
    1,seq(LinearAlgebra:-Determinant(Matrix(n,shape=Circulant[$1..n])),n=2..30); # Robert Israel, Aug 31 2014
  • Mathematica
    f[n_] := Det[ Table[ RotateLeft[ Range@ n, -j], {j, 0, n - 1}]]; Array[f, 19] (* or *)
    f[n_] := (-1)^(n - 1)*n^(n - 2)*(n^2 + n)/2; Array[f, 19]
    (* Robert G. Wilson v, Aug 31 2014 *)
    Table[Det[Table[RotateRight[Range[k],n],{n,0,k-1}]],{k,30}] (* Harvey P. Dale, Jun 20 2024 *)
  • MuPAD
    (1+n)^(n-1)*binomial(n+2,n)*(-1)^(n) $ n=0..16 // Zerinvary Lajos, Apr 01 2007
    
  • PARI
    a(n) = (n+1)*(-n)^(n-1)/2; \\ Altug Alkan, Dec 17 2017

Formula

a(n) = (-1)^(n-1) * n^(n-2) * (n^2 + n)/2.
E.g.f.[A052182] = E.g.f.[A000312] * E.g.f.[A000272], so A052182(unsigned) is "tree-like". E.g.f.: (T-T^2/2)/(1-T), where T=T(x) is Euler's tree function (see A000169). E.g.f. for signed sequence: (W+W^2/2)/(1+W), where W=W(x)=-T(-x) is the Lambert W function. - Len Smiley, Dec 13 2001
Conjecture: a(n) = -Res( f(n), x^n - 1), where Res is the resultant and f(n) = Sum_{k=1..n} k*x^k. - Benedict W. J. Irwin, Dec 07 2016

Extensions

More terms from James Sellers, Jan 31 2000

A081131 a(n) = n^(n-2) * binomial(n,2).

Original entry on oeis.org

0, 0, 1, 9, 96, 1250, 19440, 352947, 7340032, 172186884, 4500000000, 129687123005, 4086546038784, 139788510734886, 5159146026151936, 204350482177734375, 8646911284551352320, 389289535005334947848, 18580248257778920521728, 937146152681201173795569
Offset: 0

Views

Author

Paul Barry, Mar 08 2003

Keywords

Comments

Main diagonal of A081130.
a(n) is the number of partial functions f: {1,2,...,n} -> {1,2,...,n} that have exactly 2 undefined elements. - Geoffrey Critzer, Feb 08 2012
a(n+1) is the determinant of the circulant matrix having (n-1, n-2, ..., 0) as first row, for n >= 1. See A070896 for a variant, and A303260 for a related sequence. - M. F. Hasler, Apr 23 2018
a(n) is the number of birooted labeled trees on n nodes. - Brendan McKay, May 01 2018

Crossrefs

Sequences of the form (n+m)^n*binomial(n+2,2): A081133 (m=0), A081132 (m=1), this sequence (m=2), A053507 (m=3), A081196 (m=4).

Programs

  • Magma
    [n lt 2 select 0 else n^(n-2)*Binomial(n,2): n in [0..20]]; // G. C. Greubel, May 18 2021
    
  • Mathematica
    Join[{0},Table[n^(n-2) Binomial[n, 2], {n, 1, 20}]] (* Vladimir Joseph Stephan Orlovsky, Apr 19 2011 *)
  • Sage
    [0 if (n<2) else n^(n-2)*binomial(n,2) for n in (0..20)] # G. C. Greubel, May 18 2021

Formula

a(0) = a(1) = 0, a(n) = n^(n-2)*binomial(n,2).
E.g.f.: T(x)^2/(2*(1-T(x))) where T(x) is the e.g.f. for A000169. - Geoffrey Critzer, Feb 08 2012

A116956 Number of functions f:{1,2,...,n}->{1,2,...,n} with odd cycles only.

Original entry on oeis.org

1, 1, 3, 18, 157, 1800, 25551, 432376, 8494809, 190029888, 4768313275, 132626098176, 4049755214517, 134677876657792, 4845193429684167, 187490897290080000, 7765153170076158001, 342721890859339812864, 16058392049508837366771, 796093438190851834236928
Offset: 0

Views

Author

Vladeta Jovovic, Mar 30 2006

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1, add(`if`(j::odd,
           (j-1)!*b(n-j)*binomial(n-1, j-1), 0), j=1..n))
        end:
    a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);  # Alois P. Heinz, May 20 2016
  • Mathematica
    t = Sum[n^(n - 1) x^n/n!, {n, 1, 20}]; Range[0, 20]! CoefficientList[
    Series[((1 + t)/(1 - t))^(1/2), {x, 0, 20}], x]  (* Geoffrey Critzer, Dec 07 2011 *)

Formula

E.g.f.: sqrt((1-LambertW(-x))/(1+LambertW(-x))).
Sum_{k=0..n} binomial(n,k)*a(k)*a(n-k) = 2*n^n, n>0. - Vladeta Jovovic, Oct 11 2007
a(n) ~ n! * 2^(3/4)*Gamma(3/4)*exp(n)/(2*Pi*n^(3/4)). - Vaclav Kotesovec, Sep 24 2013

A066274 Number of endofunctions of [n] such that 1 is not a fixed point.

Original entry on oeis.org

0, 2, 18, 192, 2500, 38880, 705894, 14680064, 344373768, 9000000000, 259374246010, 8173092077568, 279577021469772, 10318292052303872, 408700964355468750, 17293822569102704640, 778579070010669895696, 37160496515557841043456, 1874292305362402347591138
Offset: 1

Views

Author

Len Smiley, Dec 09 2001

Keywords

Comments

a(n) is the number of functional digraphs that are not a solitary rooted tree. - Geoffrey Critzer, Aug 31 2013
For n > 1 a(n) is the number of numbers with n digits in base n. - Gionata Neri, Feb 18 2016
a(n) is the number of pairs of adjacent equal letters in all n-ary words of length n. - John Tyler Rascoe, Nov 19 2024

Examples

			a(2)=2: [1->2,2->1], [1->2,2->2].
		

Crossrefs

Programs

Formula

a(n) = n^n - n^(n-1).
E.g.f.: T^2/(1-T), where T=T(x) is Euler's tree function (see A000169).
For n > 1 a(n)=1/(Integral_{x=n..infinity} 1/x^n dx). - Francesco Daddi, Aug 01 2011
a(n) = sum(i=1..n-1, C(n,i)*(i^i*(n-i)^(n-i-1))). - Vladimir Kruchinin May 15 2013
E.g.f.: x^2*A''(x) where A(x) is the e.g.f. for A000272. - Geoffrey Critzer, Aug 31 2013
a(n) = 2*A081131(n) = 2*|A070896(n)|. - Geoffrey Critzer, Aug 31 2013

A085719 Permanent of n X n matrix whose rows are cyclic permutations of 1..n.

Original entry on oeis.org

1, 1, 5, 54, 1060, 33225, 1517028, 95036284, 7828309568, 820553006835, 106652605456000, 16835058193182834, 3172396072749375744, 703470523269606264445, 181335014313248383578368, 53768377727402203980675000, 18172294259291992881395286016
Offset: 0

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Jul 19 2003

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> `if`(n=0, 1, LinearAlgebra[Permanent](
             Matrix(n, (i, j)-> 1+irem(j+i, n)))):
    seq(a(n), n=0..17);  # Alois P. Heinz, Apr 28 2020
  • PARI
    permRWNb(a)=n=matsize(a)[1];if(n==1,return(a[1,1]));sg=1;in=vectorv(n);x=in;x=a[,n]-sum(j=1,n,a[,j])/2;p=prod(i=1,n,x[i]);for(k=1,2^(n-1)-1,sg=-sg;j=valuation(k,2)+1;z=1-2*in[j];in[j]+=z;x+=z*a[,j];p+=prod(i=1,n,x[i],sg));return(2*(2*(n%2)-1)*p)
    for(n=1,22,a=matrix(n,n,i,j,1+(j-i)%n);print1(permRWNb(a)",")) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), May 13 2007
    
  • Sage
    def A085719(n) : return matrix([[(i-j)%n+1 for j in range(n)] for i in range(n)]).permanent() # Eric M. Schmidt, May 04 2013

Extensions

More terms from Vladeta Jovovic, Jul 21 2003
a(0)=1 prepended by Alois P. Heinz, Apr 28 2020

A303260 Determinant of n X n matrix A[i,j] = (j - i - 1 mod n) + [i=j], i.e., the circulant having (n, 0, 1, ..., n-2) as first row.

Original entry on oeis.org

1, 1, 4, 28, 273, 3421, 52288, 941578, 19505545, 456790123, 11931215316, 343871642632, 10840081272265, 371026432467913, 13702802011918048, 543154131059225686, 23000016472483168305, 1036227971225610466711, 49492629462587441963140, 2497992686980609418282548, 132849300060919364474261281
Offset: 0

Views

Author

M. F. Hasler, Apr 23 2018

Keywords

Comments

It is remarkable that for odd n, this determinant has its base n+1 digits equal to the middle row: e.g., a(9) = 456790123 is the determinant of the circulant matrix having [4,5,6,7,9,0,1,2,3] as middle row.
a(0) = 1 is (by convention) the determinant of a 0 X 0 matrix.

Examples

			a(5) = 3421 is the determinant of the matrix
   ( 5 0 1 2 3 )
   ( 3 5 0 1 2 )
   ( 2 3 5 0 1 )  and 3421 = 23501[6], i.e., written in base 6.
   ( 1 2 3 5 0 )
   ( 0 1 2 3 5 ).
		

Crossrefs

Cf. A081131(n+1) = determinant of the circulant matrix C(n) defined in formula, A070896 (signed variant).
See also A219324.

Programs

  • PARI
    a(n)=matdet(matrix(n,n,i,j,(j-i-1)%n+(i==j)))
    
  • Python
    from sympy import Matrix
    def A303260(n): return Matrix(n,n, lambda i,j:(j-i-1) % n + (i==j)).det() # Chai Wah Wu, Oct 18 2021

Formula

a(n) = det(I(n) + C(n)), where I(n) is the n X n identity matrix and C(n) is the circulant having (n-1, ..., 0) as first column.

A086759 Permanent of the Cayley addition table of Z_{n}. a(n) is the permanent of the n X n matrix M_(i,j) = ((i+j) mod n) where i and j range from 0 to n-1.

Original entry on oeis.org

0, 1, 9, 164, 5050, 227508, 14064519, 1146668608, 119249333028, 15400125776000, 2417814003691405, 453536611741073664, 100178077459552487070, 25735749696251388478720, 7608415981499790110521875, 2564724413131659780025106432, 977834710569917222742633274504
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 01 2003

Keywords

Examples

			a(9) is the permanent of the matrix
0 1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8 0
2 3 4 5 6 7 8 0 1
3 4 5 6 7 8 0 1 2
4 5 6 7 8 0 1 2 3
5 6 7 8 0 1 2 3 4
6 7 8 0 1 2 3 4 5
7 8 0 1 2 3 4 5 6
8 0 1 2 3 4 5 6 7
		

Crossrefs

Programs

  • Mathematica
    Array[With[{s = Range[0, #]}, Permanent@ Array[RotateLeft[s, #] &, Last@ s + 1, 0]] &, 16, 0] (* Michael De Vlieger, Sep 03 2019 *)
  • PARI
    permRWNb(a)=n=matsize(a)[1];if(n==1,return(a[1,1]));sg=1;in=vectorv(n);x=in;x=a[,n]-sum(j=1,n,a[,j])/2;p=prod(i=1,n,x[i]);for(k=1,2^(n-1)-1,sg=-sg;j=valuation(k,2)+1;z=1-2*in[j];in[j]+=z;x+=z*a[,j];p+=prod(i=1,n,x[i],sg));return(2*(2*(n%2)-1)*p) for(n=1,21,a=matrix(n,n,i,j,((i+j-2)%n));print1(permRWNb(a)",")) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), May 14 2007
    
  • PARI
    a(n) = matpermanent(matrix(n, n, i, j, (i+j-2) % n)) \\ Stefano Spezia, Oct 25 2020

Extensions

a(9) from Neven Juric (neven.juric(AT)apis-it.hr), Jul 11 2005
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), May 14 2007
a(17) from Michael De Vlieger, Sep 03 2019

A338424 Permanent of n X n matrix whose rows are cyclic permutations of 2..prime(n).

Original entry on oeis.org

1, 2, 13, 250, 8961, 821848, 90031117, 16929468082, 3699112438993, 1172372082948016, 592930150554224105, 314980461163972949868, 237098727748233796765441, 209617206588771062279193558, 193794661072190257001413994605, 210096924743130844484817519143524, 287845708921326527700201694718406369
Offset: 0

Views

Author

Stefano Spezia, Oct 25 2020

Keywords

Examples

			a(3) = 250 because the permanent of [(2,3,5), (3,5,2), (5,2,3)] is 250.
		

Crossrefs

Programs

  • PARI
    a(n) = matpermanent(matrix(n, n, i, j, prime((i+j-2) % n + 1)))

A348183 a(n) is the determinant of the n X n matrix M = (m_{i,j}), i,j from 0 to n-1: m{i,j} = (i+j)^2 mod n.

Original entry on oeis.org

1, 0, -1, -2, 0, 250, 5616, -33614, 0, 204073344, -900000000, -9431790764, 0, 10752962364222, -1870899108384768, -36328974609375000, 0, 22899384412078526344, -111400529859275793629184, -43843094862278417487512, 0, 2870507605405055660542502550, 67015802375208384199755038720
Offset: 0

Views

Author

Keywords

Comments

It seems that for values of n divisible by 4 -> a(n) = 0 and rank(M) = n/2.

Examples

			a(2) =  |0^2 mod 2, 1^2 mod 2| = -1
        |1^2 mod 2, 2^2 mod 2|
--
        |0^2 mod 3, 1^2 mod 3, 2^2 mod 3|
a(3) =  |1^2 mod 3, 2^2 mod 3, 3^2 mod 3| = -2
        |2^2 mod 3, 3^2 mod 3, 4^2 mod 3|
		

Crossrefs

Cf. A070896.

Programs

  • Mathematica
    a[n_]:=Table[Mod[(i+j)^2,n],{i,0,n-1},{j,0,n-1}]; Join[{1},Table[Det[a[n]], {n, 22}]] (* Stefano Spezia, Oct 06 2021 *)
  • PARI
    a(n) = matdet(matrix(n, n, i, j, i--; j--; (i+j)^2 % n)); \\ Michel Marcus, Oct 06 2021
    
  • Python
    from sympy import Matrix
    def A348183(n): return Matrix(n,n,[pow(i+j,2,n) for i in range(n) for j in range(n)]).det() # Chai Wah Wu, Nov 24 2021

Extensions

a(14)-a(17) corrected by and more terms from Stefano Spezia, Oct 06 2021.
Showing 1-9 of 9 results.