login
a(n) = H(n)*n!/(floor(n/2))! (mod (n+1)), where H(n) = sum{k=1 to n} 1/k, the n-th harmonic number.
1

%I #17 Oct 11 2019 11:39:52

%S 0,1,0,3,0,5,0,2,3,4,0,0,0,6,9,0,0,0,0,0,18,10,0,0,0,12,0,0,0,0,0,0,

%T 30,16,0,0,0,18,24,0,0,0,0,0,0,22,0,0,0,0,12,0,0,0,0,0,54,28,0,0,0,30,

%U 0,0,0,0,0,0,3,0,0,0,0,36,0,0,0,0,0,0,0,40,0,0,0,42,51,0,0,0,0,0,3,46,0,0,0

%N a(n) = H(n)*n!/(floor(n/2))! (mod (n+1)), where H(n) = sum{k=1 to n} 1/k, the n-th harmonic number.

%H G. C. Greubel, <a href="/A123931/b123931.txt">Table of n, a(n) for n = 0..1000</a>

%t f[n_]:= Mod[HarmonicNumber[n]n!/Floor[n/2]!, n + 1]; Table[f[n], {n, 0, 100}] (* _Ray Chandler_, Dec 11 2006 *)

%o (PARI) a(n) = (n!*sum(k=1,n, 1/k)/(n\2)!)%(n+1);

%o vector(100, n, n--; a(n) ) \\ _G. C. Greubel_, Aug 05 2019

%o (Sage) [mod(harmonic_number(n)*factorial(n)/factorial(floor(n/2)), n+1) for n in (0..100)] # _G. C. Greubel_, Aug 05 2019

%o (GAP)List([0..100], n-> (Factorial(n)*Sum([1..n], k-> 1/k)/Factorial(Int(n/2))) mod (n+1) ); # _G. C. Greubel_, Aug 05 2019

%Y Cf. A124078.

%K easy,nonn

%O 0,4

%A _Leroy Quet_, Nov 28 2006

%E Extended by _Ray Chandler_, Dec 11 2006