[go: up one dir, main page]

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!)
A303878 Consider the representation of some integer (>1) as the sum of distinct unit fraction (<1). The sum of these denominators is least. 0
2, 3, 4, 5, 6, 8, 9, 10, 15, 18, 20, 24 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Consider the representation of 1 as the sum of distinct unit fraction (<1). We can easily found the least sum of the denominators. The solution is 1 = 1/2 + 1/3 + 1/6.
LINKS
EXAMPLE
Denominators | Sum
---------------------------------------------+-----
2, 3, 4, 5, 6, 8, 9, 10, 15, 18, 20, 24 | 124
2, 3, 4, 5, 6, 7, 10, 12, 14, 15, 20, 28 | 126
2, 3, 4, 5, 6, 7, 9, 12, 14, 18, 20, 28 | 128
2, 3, 4, 5, 6, 8, 9, 10, 12, 18, 24, 30 | 131
2, 3, 4, 5, 6, 7, 8, 12, 14, 20, 24, 28 | 133
PROG
(Ruby)
def partition(n, min, max)
return [[]] if n == 0
[max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
end
def f(n)
a = []
partition(n, 2, n).each{|ary|
sum = ary.inject(0){|s, i| s + 1 / i.to_r}
a << ary.reverse if sum.denominator == 1 && sum.numerator > 1
}
a
end
n = 1
a = []
while a == []
n += 1
a = f(n)
end
p a
CROSSREFS
Sequence in context: A256007 A324689 A280578 * A039170 A097624 A000398
KEYWORD
nonn,fini,full
AUTHOR
Seiichi Manyama, May 02 2018
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 August 29 09:09 EDT 2024. Contains 375511 sequences. (Running on oeis4.)