A126130 a(n) = (n+1)^n - n!.
1, 7, 58, 601, 7656, 116929, 2092112, 43006401, 999637120, 25933795801, 742968453888, 23297606120881, 793708546233344, 29192838847099425, 1152920196932478976, 48661170952876980481, 2185911204051268435968, 104127343895537535804841, 5242879878354899591168000
Offset: 1
Examples
The quadratic that fits (1,1), (2,8) and (3,27) is f(n) = 6n^2-11n+6. Then a(3) = f(4) = 58.
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..386
Programs
-
Magma
[(n+1)^n - Factorial(n): n in [1..20]]; // Altug Alkan, Mar 19 2018
-
Mathematica
Table[(n+1)^n-n!,{n,30 }] (* Harvey P. Dale, Jun 06 2015 *)
-
PARI
vector(18, n, (n+1)^n-n!)
Formula
The polynomial f is equal to Sum_{k=1}^n -s(n+1,k) x^{k-1}, where the s(n,k) are the Stirling numbers of the first kind (A008275). - Franklin T. Adams-Watters, Dec 25 2006
E.g.f.: -1/(1 - x) - LambertW(-x)/(x*(1 + LambertW(-x))), where LambertW() is the Lambert W-function. - Ilya Gutkovskiy, Aug 22 2018
a(n) = Sum_{k=1..n} k^n*(-1)^(n-k)*binomial(n,k-1). - Vladimir Kruchinin, Aug 15 2025
Comments