%I #8 Dec 20 2021 14:36:42
%S 1,4,25,101,655,11077,94199,2005319,62541113,530615357,3888615949,
%T 2547768661,1603125774433,510235838011,76538488318091,
%U 10462945272539099,182249306891497151,7488308007918913129,6810487755999748187
%N Numerator of second moment of the n-th term of Ulam's "history-dependent random sequence".
%H Mark Kac, <a href="https://doi.org/10.1016/0196-8858(89)90014-6">A history-dependent random sequence defined by Ulam</a>, Advances in Applied Mathematics 10.3 (1989): 270-277. See page 273, sigma_k and alpha_k.
%e 1, 4, 25/2, 101/3, 655/8, 11077/60, 94199/240, 2005319/2520, ...
%p s:=[1]; a:=[0];
%p for N from 2 to 40 do # N = n+1
%p n:=N-1;
%p t1:=s[n]+(1/n)*add(s[k],k=1..n)+2*s[n]/n+(2/n)*a[n];
%p t2:=s[n]+(1/n)*add(s[k],k=1..n)+a[n]+(2/n)*add(a[k],k=1..n);
%p s:=[op(s),t1];
%p a:=[op(a),t2];
%p od:
%p s; # sigma_n
%p a; # alpha_n
%p sn:=map(numer,s); # A329495
%p sd:=map(denom,s); # A329496
%p an:=map(numer,a); # A329497
%p ad:=map(denom,a); # A329498
%Y Cf. A329496, A329497, A327498.
%K nonn,frac
%O 1,2
%A _N. J. A. Sloane_, Nov 17 2019