%I #20 Sep 18 2022 09:07:33
%S 2,2,6,2,4,2,4,20,2,3,2,3,42,2,3,24,2,3,18,2,3,15,2,3,14,231,2,3,12,2,
%T 3,12,156,2,3,11,231,2,3,10,2,3,10,240,2,3,10,128,32640,2,3,9,2,3,9,
%U 342,2,3,9,180,2,3,9,126,2,3,9,99,2,3,9,83,34362
%N Table of denominators in the Egyptian fraction representation of n/(n+1) by the greedy algorithm.
%C A100678(n) = length of n-th row;
%C T(n, A100678(n)) = A100695(n).
%H Seiichi Manyama, <a href="/A247765/b247765.txt">Rows n = 1..1000 of triangle, flattened</a> (Rows n = 1..100 from Reinhard Zumkeller)
%e . 1: 2
%e . 2: 2, 6
%e . 3: 2, 4
%e . 4: 2, 4, 20
%e . 5: 2, 3
%e . 6: 2, 3, 42
%e . 7: 2, 3, 24
%e . 8: 2, 3, 18
%e . 9: 2, 3, 15
%e . 10: 2, 3, 14, 231
%e . 11: 2, 3, 12
%e . 12: 2, 3, 12, 156
%e . 13: 2, 3, 11, 231
%e . 14: 2, 3, 10
%e . 15: 2, 3, 10, 240
%e . 16: 2, 3, 10, 128, 32640
%e . 17: 2, 3, 9
%e . 18: 2, 3, 9, 342
%e . 19: 2, 3, 9, 180
%e . 20: 2, 3, 9, 126
%o (Haskell)
%o import Data.Ratio ((%), numerator, denominator)
%o a247765 n k = a247765_tabf !! (n-1) !! (k-1)
%o a247765_tabf = map a247765_row [1..]
%o a247765_row n = f (map recip [2..]) (n % (n + 1)) where
%o f es x | numerator x == 1 = [denominator x]
%o | otherwise = g es
%o where g (u:us) | u <= x = (denominator u) : f us (x - u)
%o | otherwise = g us
%Y Cf. A100678, A100695.
%K nonn,tabf
%O 1,1
%A _Reinhard Zumkeller_, Sep 25 2014
|