login
a(n) = Sum_{k=0..floor(n/3)} (n-3*k)^(n-3*k).
1

%I #14 Apr 16 2022 11:20:13

%S 1,1,4,28,257,3129,46684,823800,16780345,387467173,10000823800,

%T 285328450956,8916487915429,302885107416053,11112292154008972,

%U 437902806868774804,18447046958816967669,827251374178490773149,39346845978103406350228

%N a(n) = Sum_{k=0..floor(n/3)} (n-3*k)^(n-3*k).

%F G.f.: ( Sum_{k>=0} (k * x)^k )/(1 - x^3).

%t a[n_] := Sum[If[3*k == n, 1, (n - 3*k)^(n - 3*k)], {k, 0, Floor[n/3]}]; Array[a, 20, 0] (* _Amiram Eldar_, Apr 16 2022 *)

%o (PARI) a(n) = sum(k=0, n\3, (n-3*k)^(n-3*k));

%o (PARI) my(N=20, x='x+O('x^N)); Vec(sum(k=0, N, (k*x)^k)/(1-x^3))

%Y Cf. A062970, A353009.

%Y Cf. A001840, A353014, A353015.

%K nonn,easy

%O 0,3

%A _Seiichi Manyama_, Apr 16 2022