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

A217701 Permanent of the n X n matrix with all diagonal entries n and all off diagonal entries 1.

Original entry on oeis.org

1, 1, 5, 38, 393, 5144, 81445, 1512720, 32237681, 775193984, 20759213061, 612623724800, 19751688891385, 690721009155072, 26039042401938917, 1052645311044368384, 45424010394042998625, 2083972769418997760000, 101288683106200561501189, 5199006109868903819575296
Offset: 0

Views

Author

Jim Pitman, Mar 19 2013

Keywords

Comments

a(n) is the number of terms that appear before cancellations occur in the evaluation of the determinant of an n X n matrix by the usual sum over permutations of [n], for a matrix whose off diagonal entries are specified, and each of whose diagonal entries is minus the sum of the negatives of the off diagonal entries and one additional term, as in the usual presentation of the matrix in the Matrix Tree Theorem.
The number a(n-1) - n^(n-2) (A000272) is the number of terms which cancel in Zeilberger's proof of the Matrix Tree Theorem. This number is even, as the terms which cancel are equal in magnitude with opposite sign, and as is also apparent from the formula in terms of A087981(n) which is a corollary of Zeilberger's proof.
Formula involves the derangement numbers A000166 which count permutations with no fixed points, also the number A087981 of colored permutations with no fixed points of n elements where each cycle is one of two colors.
Number of permutations of [n] where the fixed points are n-colored and all other points are unicolored. - Alois P. Heinz, Apr 23 2020

Crossrefs

Also closely related to A058127.
Main diagonal of A089258.
Cf. A176043.

Programs

  • Maple
    a:= n-> n!*coeff(series(exp((n-1)*x)/(1-x), x, n+1), x, n):
    seq(a(n), n=0..23);  # Alois P. Heinz, Apr 23 2020
    # second Maple program:
    b:= proc(n, k) option remember; `if`(n<1, 1-n,
          (n+k-1)*b(n-1, k)+(k-1)*(1-n)*b(n-2, k))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..23);  # Alois P. Heinz, Apr 23 2020
    # third Maple program:
    b:= proc(n, k) option remember;
          `if`(min(n, k)<0, 0, n*b(n-1, k)+(k-1)^n)
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..23);  # Alois P. Heinz, Apr 23 2020
  • Mathematica
    derange[0,z_]:=1; derange[n_,z_]:= Pochhammer[z,n] - Sum[ Binomial[n,k] z^(n-k) derange[k,z], {k,0,n-1}]; a[n_]:= Sum[ Binomial[n,k] derange[n-k,1] n^k, {k,0,n}] ; a/@ Range[0,10]
    derange[0,z_]:=1; derange[n_,z_]:= Pochhammer[z,n] - Sum[ Binomial[n,k] z^(n-k) derange[k,z], {k,0,n-1}]; a[n_]:= Sum[ Binomial[n,j] derange[n-j,2] (n+1)^(j-1) (n-j+1), {j,0,n}]; a/@ Range[0,10]
    (* Alternative: *)
    a[n_] := Exp[n - 1] Gamma[n + 1, n - 1];
    Table[a[n], {n, 0, 19}]  (* Peter Luschny, Dec 24 2021 *)

Formula

a(n) = Sum_{k=0..n} C(n,k)*D_{n-k}*n^k, where D_n = A000166(n).
a(n) = Sum_{j=0..n} C(n,k)*D_{n-k,2} (n+1)^(j-1) (n-j+1) where D_{n,2} = A087981(n).
a(n) = n! * [x^n] exp((k-1)*x)/(1-x). - Alois P. Heinz, Apr 23 2020
a(n) = exp(n-1)*Gamma(n+1, n-1). - Peter Luschny, Dec 24 2021

Extensions

a(0),a(16)-a(19) from Alois P. Heinz, Apr 23 2020

A176045 Numbers n such that n-1 and 2*n-1 are both prime.

Original entry on oeis.org

3, 4, 6, 12, 24, 30, 42, 54, 84, 90, 114, 132, 174, 180, 192, 234, 240, 252, 282, 294, 360, 420, 432, 444, 492, 510, 594, 642, 654, 660, 684, 720, 744, 762, 810, 912, 954, 1014, 1020, 1032, 1050, 1104, 1224, 1230, 1290, 1410, 1440, 1452, 1482, 1500, 1512, 1560
Offset: 1

Views

Author

Michel Lagneau, Apr 07 2010

Keywords

Comments

Also numbers n such that all eigenvalues of the n X n matrix M_n defined in A176043 are prime. The eigenvalues are 2*n-1, and n-1 with multiplicity n-1.
a(n)^2 = p^2 + q, where both p and q are primes. These are the only squares of this form, and which always yields q > p with a(n) - 1 = p = A005384(n) and 2*a(n) - 1 = q = A005385(n), for the same n. Also: a(n) = q - p; p + q + a(n) = 2q = A194593(n+1); and p*q = A156592 - Richard R. Forberg, Mar 04 2015

Examples

			6-1 = 5 and 2*6-1 = 11 are both prime, so 6 is in the sequence. 7-1 = 6 and 2*7-1 = 13 are not both prime, so 7 is not in the sequence.
p = 3, q = 7; p^2 + q = 16, a(n) = sqrt(16) = 4. - _Richard R. Forberg_, Mar 04 2015
		

Crossrefs

Cf. A176043, A005384 (Sophie Germain primes), A005385 (Safe Primes), A124485 (2*n-1 and 4*n-1 are prime).

Programs

  • Magma
    [ n: n in [2..1600] | IsPrime(n-1) and IsPrime(2*n-1) ]; // Klaus Brockhaus, Apr 19 2010
    
  • Maple
    with(numtheory):for n from 2 to 2000 do:if type((2*n-1),prime)=true and type((n-1),prime)=true then print(n):else fi:od:
  • Mathematica
    Select[Prime[Range[250]],PrimeQ[2#+1]&]+1 (* Harvey P. Dale, Jul 31 2013 *)
  • PARI
    isok(n) = isprime(n-1) && isprime(2*n-1); \\ Michel Marcus, Apr 06 2016

Formula

a(n) = A005384(n)+1.
a(n) = 2*A124485(n-1) for n > 1.

Extensions

Edited and 1482 inserted by Klaus Brockhaus, Apr 19 2010

A362885 Array read by ascending antidiagonals: A(n, k) = (1 + 2*n)*k^n.

Original entry on oeis.org

1, 0, 1, 0, 3, 1, 0, 5, 6, 1, 0, 7, 20, 9, 1, 0, 9, 56, 45, 12, 1, 0, 11, 144, 189, 80, 15, 1, 0, 13, 352, 729, 448, 125, 18, 1, 0, 15, 832, 2673, 2304, 875, 180, 21, 1, 0, 17, 1920, 9477, 11264, 5625, 1512, 245, 24, 1, 0, 19, 4352, 32805, 53248, 34375, 11664, 2401, 320, 27, 1
Offset: 0

Views

Author

Stefano Spezia, May 08 2023

Keywords

Examples

			The array begins:
    1,  1,   1,    1,     1,     1, ...
    0,  3,   6,    9,    12,    15, ...
    0,  5,  20,   45,    80,   125, ...
    0,  7,  56,  189,   448,   875, ...
    0,  9, 144,  729,  2304,  5625, ...
    0, 11, 352, 2673, 11264, 34375, ...
    ...
		

Crossrefs

Cf. A000007 (k=0), A000012 (n=0), A004248, A005408 (k=1), A008585 (n=1), A014480 (k=2), A033429 (n=2), A058962 (k=4), A124647 (k=3), A155988 (k=9), A171220 (k=5), A176043, A199299 (k=6), A199300 (k=7), A199301 (k=8), A244727 (n=3), A362886 (antidiagonal sums).

Programs

  • Mathematica
    A[n_,k_]:=(1+2n)k^n; Join[{1}, Table[A[n-k,k],{n,10},{k,0,n}]]//Flatten (* or *)
    A[n_,k_]:=SeriesCoefficient[(1+k*x)/(1-k*x)^2,{x,0,n}]; Table[A[n-k,k],{n,0,10},{k,0,n}]//Flatten (* or *)
    A[n_,k_]:=n!SeriesCoefficient[Exp[k*x](1+2k*x),{x,0,n}]; Table[A[n-k,k],{n,0,10},{k,0,n}]//Flatten

Formula

A(n, k) = A005408(n)*A004248(n, k).
O.g.f. of column k: (1 + k*x)/(1 - k*x)^2.
E.g.f. of column k: exp(k*x)*(1 + 2*k*x).
A(n, n) = A176043(n+1).
Showing 1-3 of 3 results.