[go: up one dir, main page]

login
Revision History for A303878 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Consider the representation of some integer (>1) as the sum of distinct unit fraction (<1). The sum of these denominators is least.
(history; published version)
#24 by Charles R Greathouse IV at Tue Feb 05 22:43:47 EST 2019
STATUS

editing

approved

#23 by Charles R Greathouse IV at Tue Feb 05 22:43:39 EST 2019
KEYWORD

nonn,fini,full

STATUS

approved

editing

#22 by Bruno Berselli at Tue Oct 23 10:32:50 EDT 2018
STATUS

proposed

approved

#21 by Seiichi Manyama at Tue Oct 23 10:28:19 EDT 2018
STATUS

editing

proposed

#20 by Seiichi Manyama at Tue Oct 23 10:26:22 EDT 2018
PROG

sum = ary.inject(0){|s, i| s += 1 / i.to_r}

STATUS

approved

editing

#19 by Susanna Cuyler at Wed May 02 09:23:38 EDT 2018
STATUS

proposed

approved

#18 by Seiichi Manyama at Wed May 02 08:52:15 EDT 2018
STATUS

editing

proposed

#17 by Seiichi Manyama at Wed May 02 08:52:11 EDT 2018
EXAMPLE

Denominators | Sum | Reciprocal sum

--------------------------------------------------------------------

---------------------------------------------+-----

2, 3, 4, 5, 6, 8, 9, 10, 15, 18, 20, 24 | 124 | 2

2, 3, 4, 5, 6, 7, 10, 12, 14, 15, 20, 28 | 126 | 2

2, 3, 4, 5, 6, 7, 9, 12, 14, 18, 20, 28 | 128 | 2

2, 3, 4, 5, 6, 8, 9, 10, 12, 18, 24, 30 | 131 | 2

2, 3, 4, 5, 6, 7, 8, 12, 14, 20, 24, 28 | 133 | 2

STATUS

proposed

editing

#16 by Seiichi Manyama at Wed May 02 07:33:16 EDT 2018
STATUS

editing

proposed

#15 by Seiichi Manyama at Wed May 02 07:25:27 EDT 2018
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