%I #24 Feb 15 2024 20:49:06
%S 1,1,3,18,161,1900,27755,482552,9722113,222612624,5707904499,
%T 161981127968,5039646554593,170561613679808,6237995487261915,
%U 245159013138710400,10303367499652761601,461102348510408544512,21891769059478538933603,1098983344602124698522112
%N Real part of (n + i)^n, with i=sqrt(-1).
%C Imaginary part: A115416.
%H Seiichi Manyama, <a href="/A115415/b115415.txt">Table of n, a(n) for n = 0..386</a>
%F a(n) = n! * [x^n] exp(n*x)*cos(x). - _Ilya Gutkovskiy_, Apr 10 2018
%F a(n) ~ cos(1) * n^n. - _Vaclav Kotesovec_, Jun 08 2019
%F a(n) = Sum_{j=0..floor(n/2)} binomial(n,2j)*n^(n-2j)*(-1)^j. - _Chai Wah Wu_, Feb 15 2024
%t Table[ Re[(n + I)^n], {n, 0, 17}] (* _Robert G. Wilson v_, Jan 23 2006 *)
%o (PARI) a(n) = real((n + I)^n); \\ _Michel Marcus_, Apr 11 2018
%o (Python)
%o from math import comb
%o def A115415(n): return sum(comb(n,j)*n**(n-j)*(-1 if j&2 else 1) for j in range(0,n+1,2)) # _Chai Wah Wu_, Feb 15 2024
%Y Cf. A000312, A009545, A115416.
%K nonn
%O 0,3
%A _Reinhard Zumkeller_, Jan 22 2006
%E More terms from _Robert G. Wilson v_, Jan 23 2006