login
a(n) = (n^n - n^2)/2.
1

%I #19 Jan 09 2024 08:48:52

%S 0,0,9,120,1550,23310,411747,8388576,193710204,4999999950,

%T 142655835245,4458050224056,151437553296042,5556003412778910,

%U 218946945190429575,9223372036854775680,413620130943168381944,19673204037648268787550,989209827830156794561809,52428799999999999999999800

%N a(n) = (n^n - n^2)/2.

%H Harvey P. Dale, <a href="/A214698/b214698.txt">Table of n, a(n) for n = 1..386</a>

%F a(n) = A214647(n) - n^2 = A117694(n) - A000217(n).

%F E.g.f.: (-1/2)*(lambertW(-x)/(1 + lambertW(-x)) + x*(x+1)*exp(x)). - _G. C. Greubel_, Jan 08 2024

%e a(3) = (27 - 9)/2 = 9.

%p A214698:= proc(n)

%p (n^n-n^2)/2 ;

%p end proc: # _R. J. Mathar_, Aug 07 2012

%t Table[(n^n-n^2)/2,{n,30}] (* _Harvey P. Dale_, Dec 25 2022 *)

%o (Python)

%o for n in range(1, 22):

%o print (n**n - n*n)/2,

%o (Magma) [(n^n -n^2)/2: n in [1..30]]; // _G. C. Greubel_, Jan 08 2024

%o (SageMath) [(n^n -n^2)/2 for n in range(1,31)] # _G. C. Greubel_, Jan 08 2024

%Y Cf. A124797 is essentially equal to (n^n-n)/2.

%Y Cf. A000217, A117694, A214647.

%K nonn,easy

%O 1,3

%A _Alex Ratushnyak_, Jul 26 2012