login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1; a(n) = Sum_{k=1..n-1, gcd(n,k) = 1} Stirling2(n,k)*a(k).
1

%I #9 Mar 08 2021 22:26:41

%S 1,1,4,25,366,5491,176569,5332097,276268942,13470365431,1135683784753,

%T 75066413338423,9256260956838520,918768523598548169,

%U 140268128758724744770,18398287904991375995745,3879391299475140314514162,594721341754741064012714341

%N a(1) = 1; a(n) = Sum_{k=1..n-1, gcd(n,k) = 1} Stirling2(n,k)*a(k).

%H G. C. Greubel, <a href="/A308476/b308476.txt">Table of n, a(n) for n = 1..250</a>

%p a := proc(n) local j; option remember;

%p if n = 1 then 1;

%p else add(`if`(gcd(n, j) = 1, Stirling2(n, j)*a(j), 0), j = 1 .. n - 1);

%p end if; end proc;

%p seq(a(n), n = 1 .. 30); # _G. C. Greubel_, Mar 08 2021

%t a[n_] := Sum[If[GCD[n, k] == 1, StirlingS2[n, k] a[k], 0], {k, 1, n - 1}]; a[1] = 1; Table[a[n], {n, 1, 18}]

%o (Sage)

%o @CachedFunction

%o def a(n):

%o if n==1: return 1

%o else: return sum( stirling_number2(n,j)*a(j) if gcd(n,j)==1 else 0 for j in (1..n-1) )

%o [a(n) for n in (1..30)] # _G. C. Greubel_, Mar 08 2021

%Y Cf. A005121, A045545, A308463.

%K nonn

%O 1,3

%A _Ilya Gutkovskiy_, May 29 2019