|
|
A036360
|
|
a(n) = Sum_{k=1..n} n! * n^(n-k+1) / (n-k)!
|
|
1
|
|
|
1, 12, 153, 2272, 39225, 776736, 17398969, 435538944, 12058401393, 366021568000, 12090393761721, 431832459644928, 16585599200808937, 681703972229640192, 29858718555221585625, 1388451967046195347456, 68316647610168842824161, 3546179063131198669848576, 193670918442059606406896473
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
This formula is given as a solution to Exercise 1.15a in the Harary and Palmer reference on page 30. However, the formula may not be correct and could be a misprint for Sum_{k=2..n} n! * n^(n-k-1) / (n-k)! which is a formula for A000435(n). - Andrew Howroyd, Feb 06 2024
It appears that a(n) * n^-(n+1) is the mean position of the first duplicate in sequences of n elements randomly drawn with replacement. - Brian P Hawkins, Jan 06 2024
|
|
REFERENCES
|
F. Harary and E. Palmer, Graphical Enumeration, (1973), p. 30, Exercise 1.15a.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = Sum_{k=1..n} n! * k^2 * n^(n-k) / (n-k)!. - Brian P Hawkins, Jan 06 2024
|
|
MAPLE
|
f := proc(n) local k; add(n!*n^(n-k+1)/(n-k)!, k=1..n); end;
|
|
MATHEMATICA
|
Table[Sum[n!*n^(n-k+1)/(n-k)!, {k, 1, n}], {n, 19}] (* James C. McMahon, Feb 07 2024 *)
|
|
PROG
|
(Python)
def a(n):
total_sum = 0
for k in range(1, n + 1):
term = (math.factorial(n) / math.factorial(n - k))*(k**2)*(n**(n - k))
total_sum += term
return total_sum
(PARI) a(n) = sum(k=1, n, n! * n^(n-k+1) / (n-k)!) \\ Andrew Howroyd, Jan 06 2024
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|