login
Minimum positive numerator of s_1/1 + ... + s_n/n in lowest terms, where each s_i equals 1 or -1.
3

%I #37 Jan 12 2020 17:40:46

%S 1,1,1,1,7,1,11,9,11,11,23,23,607,251,59,25,97,97,2647,2647,1337,457,

%T 8917,8917,7951,4261,12439,12439,587971,587971,9687661,13828799,

%U 505163,1554793,1554793,1554793,1526171

%N Minimum positive numerator of s_1/1 + ... + s_n/n in lowest terms, where each s_i equals 1 or -1.

%e 1/1 - 1/2 - 1/3 + 1/4 - 1/5 - 1/6 = 1/20, so a(6)=1.

%t nMax = 19; d = {0}; Table[d = Flatten[{d + 1/n, d - 1/n}]; Min[Abs[Numerator[d]]], {n, nMax}] (* _T. D. Noe_, Nov 19 2013 *)

%o (PARI) a(n) = {lcmn = 1;for (i=1, n, lcmn = lcm(i, lcmn)); minn = lcmn; for (i=0, 2^(n-1)-1, b = binary(i); while (#b != n, b = concat(0, b);); num = numerator(abs(sum(ii = 1, n, (-1)^b[ii]/ii))); minn = min(minn, num);); return(minn);} \\ _Michel Marcus_, Jun 15 2013

%Y Cf. A061194.

%Y Cf. A232090 (minimal possible denominator).

%K nonn

%O 1,5

%A Greg Martin (gerg(AT)math.toronto.edu), Apr 19 2001

%E More terms from _Naohiro Nomoto_, Jun 24 2001

%E a(22)-a(25) from _Zak Seidov_, Nov 20 2013

%E a(26)-a(33) from _Zak Seidov_, Nov 24 2013

%E a(34)-a(37) from _Giovanni Resta_, Jun 12 2016