
-----------------------------------
bugzpodder
Thu May 06, 2004 7:35 am

A million dollar question
-----------------------------------
similar to the halting problem
will this function terminate for all values of n (prove it)?  if not, find a value of n such that it doesnt.  (if you do, somebody will give you $1,000,000)

int f(int n){
if (n==1) return 1; 
else if (n%2==0) return f(n/2);
else return f(3*n+1);
}

function f(n:int):int
   if n=1 then
      result 1
   elsif n mod 2=0 then
      result f(n/2);
   else 
        result f(3*n+1);
   end if
end f

-----------------------------------
Martin
Thu May 06, 2004 11:31 am


-----------------------------------
negative values of n won't terminate.

pwn3d.

-----------------------------------
bugzpodder
Thu May 06, 2004 1:43 pm


-----------------------------------
good, get your million dollar at:

www.I-want-to-get-a-million-dollar-so-give-it-to-me.com

-----------------------------------
Mazer
Thu May 06, 2004 7:28 pm


-----------------------------------
Bugz, I think you mispelled the URL or something, the link didn't work for me.  :cry:

-----------------------------------
Martin
Thu May 06, 2004 7:32 pm


-----------------------------------
Mazer you rock.

-----------------------------------
Mazer
Thu May 06, 2004 7:37 pm


-----------------------------------
Wha? Why do I rock? Darkness, did the link work for you? I sure could use the million dollars... I broke my original CDs and I need to buy myself a new copy of Linux.

-----------------------------------
bugzpodder
Thu May 06, 2004 7:57 pm


-----------------------------------
sorry, darkness is the only one eligible for the million dollars.  ask him to split the money.  btw it is not a link.  it is a certificate (use print screen to get it and goto paint and paste it and print it) and you can redeem it at your local bank.

-----------------------------------
Mazer
Thu May 06, 2004 8:00 pm


-----------------------------------
So if I get to the bank with the certificate before Darkn--

-----------------------------------
Martin
Thu May 06, 2004 9:34 pm


-----------------------------------
zero doesn't work either ;) Come on mazer, you just missed the boat.

-----------------------------------
PaddyLong
Fri May 07, 2004 9:13 am


-----------------------------------
the boat to the bank?  or what boat are we talkin here?
