login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A232112 Denominator of smallest nonnegative fraction of form +- 1 +- 1/2 +- 1/3 ... +- 1/n. 3
1, 1, 2, 6, 12, 60, 20, 420, 840, 2520, 2520, 27720, 27720, 360360, 360360, 360360, 144144, 12252240, 12252240, 232792560, 232792560, 232792560, 46558512, 5354228880, 5354228880, 2974571600, 26771144400, 80313433200 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Numerators are A232111.
LINKS
EXAMPLE
1-1/2-1/3-1/4+1/5 = 7/60. No other choice of term signs yields a smaller nonnegative fraction, so a(5) = 60.
0/1, 1/1, 1/2, 1/6, 1/12, 7/60, 1/20, 11/420, 13/840, 11/2520, 11/2520, 23/27720, 23/27720, 607/360360, 251/360360, 251/360360, 25/144144, 97/12252240, ...
MATHEMATICA
nMax = 19; d = {0}; Table[d = Flatten[{d + 1/n, d - 1/n}]; Denominator[Min[Abs[d]]], {n, nMax}] (* T. D. Noe, Nov 20 2013 *)
PROG
(PARI) a(n, t=0)=if(n==1, denominator(abs(n-t)), min(a(n-1, t-1/n), a(n-1, t+1/n))) \\ Charles R Greathouse IV, Apr 06 2014
(Python)
from math import lcm, gcd
from itertools import product
def A232112(n):
if n <= 1: return 1
m = lcm(*range(2, n+1))
mtuple = tuple(m//i for i in range(2, n+1))
return m//gcd(m, min(abs(m+sum(d[i]*mtuple[i] for i in range(n-1))) for d in product((-1, 1), repeat=n-1))) # Chai Wah Wu, Nov 25 2021
CROSSREFS
Cf. A232111.
Sequence in context: A203811 A002805 A231693 * A117481 A343277 A341617
KEYWORD
nonn,frac
AUTHOR
David W. Wilson, Nov 18 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 5 18:56 EDT 2024. Contains 372277 sequences. (Running on oeis4.)