login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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) = n^2 * A001865(n). - Gerald McGarvey, Apr 17 2008
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
# Brian P Hawkins, Jan 06 2024
(PARI) a(n) = sum(k=1, n, n! * n^(n-k+1) / (n-k)!) \\ Andrew Howroyd, Jan 06 2024
CROSSREFS
Sequence in context: A189490 A180808 A004356 * A120657 A015612 A085260
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Offset corrected by Brian P Hawkins, Jan 06 2024
Name edited by Andrew Howroyd, Feb 06 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 09:22 EDT 2024. Contains 371905 sequences. (Running on oeis4.)