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.

A064636 Number of derangements up to cyclic rotations; permutation siteswap necklaces, with no fixed points (no "zero-throws", i.e., empty hands, if we use the mapping Perm2SiteSwap1 of A060495 and A060498).

Original entry on oeis.org

0, 0, 1, 2, 5, 12, 55, 270, 1893, 14864, 133749, 1334970, 14687195, 176214852, 2290820923, 32071104006, 481066907653, 7697064251760, 130850098582189, 2355301661033970, 44750731672347273, 895014631193654828, 18795307257304746591, 413496759611120779902, 9510425471105377569963, 228250211305338670543432
Offset: 0

Views

Author

Antti Karttunen, Oct 02 2001

Keywords

Comments

This sequence counts derangements (enumerated by A000166) up to the same automorphism as permutations (enumerated by A000142) are subjected to in A061417.

Programs

  • Maple
    with(numtheory); A064636 := proc(n) local d,k,s; s := 0; for d in divisors(n) do s := s + (1/n) * phi(n/d) * ( (((n/d)^d)*A000166(d)) + add((((n/d)^(d-k)) * (((n/d)-1)^k) * (A000166(d-k)*binomial(d,k))),k=1..d)); od; RETURN(s); end;
  • Mathematica
    Unprotect[Power]; 0^0 = 1; a[n_] := (1/n) DivisorSum[n, EulerPhi[n/#]*Sum[ (n/#)^(# - k)*(n/# - 1)^k*#!*Gamma[# - k + 1, -1]/(E*k!*(# - k)!), {k, 0, #}]&] // FunctionExpand; a[0] = 0; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Mar 06 2016 *)

Formula

a(n) = Sum_{d|n} (1/n) * Phi(n/d) * Sum_{k=0..d} [ ((n/d)^(d-k)) * (((n/d)-1)^k) * A008290(d, k) ]. (Note: this abbreviated formula supposes that 0^0 = 1. For a practical implementation, see the Maple procedure below.)