The odd-greedy algorithm problem

We start with a simple numerical observation:

  • 2/7 = 1/4+1/28 represents 2/7 (which has an odd denominator)
    as a sum of unit fractions
    all of whose denominators are even
  • 2/7 = 1/5+1/13+1/115+1/10465 represents the same 2/7
    as a sum of unit fractions
    all of whose denominators are odd

A natural question to ask is this: if a/b is a fraction with an odd denominator, does it have an egyptian fraction representation with all denominators odd? (It is automatic that a fraction - in reduced form - with an even denominator, could not have such a representation.)

It has been proved (R. Breusch; see References) that every a/b , with b odd , has an egyptian fraction representation in which every denominator is also odd .

The first of the above representations of 2/7 is clearly obtained by applying the standard greedy algorithm, but the second representation is obtained by making the following odd-greedy modification. Start by asking if we may represent 2/7 by:

2/7 = 1/n[1]+1/n[2]+`...`+1/n[r] with all the n[1], n[2], `...`, n[r] odd

and see how far we can get by attempting to use the standard greedy algorithm:

  • r[0] = 2/7 and we attempt n[1] = ceil(1/r[0]) = ceil(7/2) = 4 is even . Now we attempt the second closest unit fraction, the one with denominator 5. So we set: n[1] = 5 . That leads to r[0] = 2/7 = 1/5+r[1] which gives r[1] = 2/7-1/5 = (2.5-7.1)/7.5 = 3/35 , and the thing to note is the increased numerator (that novel behaviour means we now have a problem on our hands...). However, we have 2/7 = 1/5+3/35 , and we plough on with the 3/35 to see:
  • r[1] = 3/35 and we attempt n[2] = ceil(1/r[1]) = ceil(35/3) = 12 is even . So we attempt n[2] = 13 , the next best denominator. That leads to r[1] = 3/35 = 1/13+r[2] which gives r[2] = 3/35-1/13 = (3.13-35.1)/35.13 = 4/455 , and we note there is yet another increased numerator. So far 2/7 = 1/5+1/13+4/455 , and we plough on with 4/455 to see:
  • r[2] = 4/455 and we attempt n[3] = ceil(1/r[2]) = ceil(455/4) = 114 is even . So we attempt n[3] = 115 , the next best denominator. That leads to r[2] = 4/455 = 1/115+r[3] which gives r[4] = 4/455-1/115 = (4.115-455.1)/455.115 = 5/52325 = 1/10465 , is a unit fraction (that's 1/n[4] ) with an odd denominator!!

Thus we have ended up with 2/7 = 1/5+1/13+1/115+1/10465 .

Advice. Do some examples to get the hang of this modification to the standard greedy algorithm.

'Doing' 2/3 leads to the representation 1/3+1/5+1/9+1/45 . Don't allow that 1/3 to put you off.

Do these examples: 2/5, 2/9 and 3/25 .

The odd-greedy algorithm (unanswered) question is simply this :
does the above process always
terminate ?

The point of that question should be obvious:

  • With the regular greedy algorithm there is the (proven) decrease in the successive numerators; it's precisely that which gaurantees the termination

HOWEVER

  • When one attempts the odd-greedy modification, the behaviour of successive denominators can be, and generally is, quite different . And while the sequence of successive r 's is decreasing (but their integral numerators may not be), there is the prospect that that could exist some initial fraction r[0] which leads to an infinite sequence: r[1], r[2], r[3], `ad inf`
    See Stan Wagon's email below.

(An interesting elementary question to investigate is: how many fractions (with odd numerator) can one produce for which the greedy and odd-greedy algorithms produce the same output. For example, 3/7 = 1/3+1/11+1/231 is produced by both.)

I have adapted our earlier ordinary greedy algorithm to put the above odd greedy approach into effect. I could write a more sophisticated one (one, for example that would reject an input 'R' which didn't have an odd numerator), but I want to keep everything to a minimum.

The thinking behing the lines should be obvious to anyone who has done hand examples.

> odd_egypt := proc(R)
local r, n, k; r[0] := R:
if ceil(1/r[0]) mod 2 = 1 then n[1] := ceil(1/r[0]);
else n[1] := ceil(1/r[0]) + 1;
fi: r[1] := r[0] - 1/n[1];
for k from 2 while r[k-1] <> 0 do
if ceil(1/r[k-1]) <= n[k-1] then n[k] := n[k-1] + 2;
elif ceil(1/r[k-1]) mod 2 = 1 then n[k] := ceil(1/r[k-1]);
else n[k] := ceil(1/r[k-1])+1;
fi; r[k] := r[k-1] - 1/n[k];
od: seq(1/n[j], j=1..k-1); end:

>

> odd_egypt(2/7); # the above initial example

1/5, 1/13, 1/115, 1/10465

> odd_egypt(8/9);

1/3, 1/5, 1/7, 1/9, 1/11, 1/95, 1/6585, 1/28901565

> odd_egypt(14/15);

1/3, 1/5, 1/7, 1/9, 1/11, 1/19, 1/403, 1/103237, 1/...

> odd_egypt(3/13);

1/5, 1/33, 1/2145

>

Some small numerator examples (producing smallish denominators) are:

> odd_egypt(2/3);
odd_egypt(2/5);
odd_egypt(2/9);
odd_egypt(3/5);
odd_egypt(3/7);
odd_egypt(3/11);

1/3, 1/5, 1/9, 1/45

1/3, 1/15

1/5, 1/45

1/3, 1/5, 1/15

1/3, 1/11, 1/231

1/5, 1/15, 1/165

>

Some small numerator examples that produce large denominators are:

> odd_egypt(2/11);
odd_egypt(2/19);
odd_egypt(2/23);
odd_egypt(3/17);
odd_egypt(3/23);

1/7, 1/27, 1/521, 1/216633, 1/39107997275, 1/305887...

1/11, 1/71, 1/3711, 1/11013507, 1/101081102685701, ...

1/13, 1/101, 1/7551, 1/45606531, 1/1733296345938437...

1/7, 1/31, 1/739, 1/454363, 1/176953033439

1/9, 1/53, 1/2195, 1/6020337, 1/48325937437755

>

In October 1996, Stan Wagon announced a quite extraordinary numerical discovery : Here are two emails of Wagon's (in the public domain) which capture the excitement of his discovery:

Date: Sat, 12 Oct 1996 17:05:31 -0700 (PDT)
From: [email protected]
Subject: Odd Greediness
To: [email protected]
-----------------------------------------------------------------
I am busily updating my Egyptian fraction algorithms for a revision of MinA. I was testing your heuristic for the Odd Greedy, when I discovered 3/179. Odd Greedy does not do well on this at all. In fact, I have not completed the representation. So far I am at a term with 55,000 digits. The number of digits is doubleing at each stage. I hesitate to suggest that this might be a counterexample...... stan wagon

Date: Sun, 13 Oct 1996 12:11:32 -0700 (PDT)
From: [email protected]
Subject: an amazing Egyptian fraction
To: Klee, Campbell, Guy, Eppstein, Wellin
------------------------------------------------------------------
The number 3/179 has a rather amazing output when the greedy odd Egyptian fraction algorithm is tried out on it. Recall that it is a famous open question whether
ODD GREEDY always halts. On 3/179 the algorithm produces 19 terms, the last of which has 439492 digits!!! Takes a little under an hour for my computer to get this. AND the sequence of numerators of the remainders is somewhat amazing :

3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 2, 3, 4, 1
Of course, when I saw the 3, 4, 5, 6... I thought I was on to something....could this continue forever? Well, I don't think so.

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

Wagon's 439492 digits may be verified with the program above (obviously I won't save it for placing on web site!!):

> # odd_egypt(3/179);

>

I have modified the earlier odd_egypt procedure to make it stop after a certain number of steps, BOUND (I've simply removed the 'while' line and replaced it with "for k from 2 to BOUND do"):

> stop_odd_egypt := proc(R, BOUND)
local r, n, k; r[0] := R:
if ceil(1/r[0]) mod 2 = 1 then n[1] := ceil(1/r[0]);
else n[1] := ceil(1/r[0]) + 1;
fi: r[1] := r[0] - 1/n[1];
for k from 2 to BOUND do
if ceil(1/r[k-1]) <= n[k-1] then n[k] := n[k-1] + 2;
elif ceil(1/r[k-1]) mod 2 = 1 then n[k] := ceil(1/r[k-1]);
else n[k] := ceil(1/r[k-1])+1;
fi; r[k] := r[k-1] - 1/n[k];
od:
print(seq(1/n[j], j = 1..k-1));
lprint(`See the numerators, including the initial one:`);
seq(numer(r[j]), j=0..BOUND); end:

> stop_odd_egypt(3/179, 5);

1/61, 1/2731, 1/5963959, 1/29640666497443, 1/753059...

`See the numerators, including the initial one:`

3, 4, 5, 6, 7, 8

>

You may verify the first few by hand:

ceil(1/(3/179)) = ceil(179/3) = ceil(59+2/3) = 60 , is even, so go to denominator 61
Then
3/179-1/61 = (3.61-179.1)/179.61 = (183-179)/10919 = 4/10919 , etc

> 3/179 - 1/61;

4/10919

> 4/10919 - 1/2731;

5/29819789

> 5/29819789 - 1/5963959;

6/177843998984651

> stop_odd_egypt(3/2879, 4);

1/961, 1/691681, 1/382737392929, 1/1220732599546903...

`See the numerators, including the initial one:`

3, 4, 5, 6, 7

> stop_odd_egypt(5/5809, 4);

1/1163, 1/1125979, 1/1086709195543, 1/1033319766216...

`See the numerators, including the initial one:`

5, 6, 7, 8, 9

>

Contact details 

After August 31st 2007 please use the following Gmail address: jbcosgrave at gmail.com


This page was last updated 18 February 2005 15:07:04 -0000