OFFSET
1,2
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
D. P. Walsh, A differentiation-based characterization of primes, Abstracts Amer. Math. Soc., 25 (No. 2, 2002), p. 339, #975-11-237.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..450
R. K. Guy, Letter to N. J. A. Sloane, Jul 1988
D. P. Walsh, Primality test based on the generating function
D. P. Walsh, A differentiation-based characterization of primes
H. S. Wilf, Three problems in combinatorial asymptotics, J. Combin. Theory, A 35 (1983), 199-207.
FORMULA
a(n) = n!*sum(((n/k)!*k^(n/k))^(-1)) where sum is over all divisors k of n. Exponential generating function [for a(1) through a(n)]= sum(exp(t^k/k)-1, k=1..n).
a(n) = (n-1)! + 1 iff n is a prime.
EXAMPLE
For example, a(4)=10 since, of the 24 permutations of length 4, there are 6 permutations with consist of a single 4-cycle, 3 permutations that consist of two 2-cycles and 1 permutation with four 1-cycles.
Also, a(7)=721 since there are 720 permutations with a single cycle of length 7 and 1 permutation with seven 1-cycles.
MAPLE
a:= n-> n!*add((d/n)^d/d!, d=numtheory[divisors](n)):
seq(a(n), n=1..30); # Alois P. Heinz, Nov 07 2012
MATHEMATICA
Table[n! Sum[((n/d)!*d^(n/d))^(-1), {d, Divisors[n]}], {n, 21}] (* Jean-François Alcover, Apr 04 2011 *)
PROG
(Maxima) a(n):= n!*lsum((d!*(n/d)^d)^(-1), d, listify(divisors(n)));
makelist(a(n), n, 1, 40); /* Emanuele Munarini, Feb 03 2014 */
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
Additional comments from Dennis P. Walsh, Dec 08 2000
More terms from Vladeta Jovovic, Dec 01 2001
STATUS
approved