 then posted to Stack Overflow - but some people decided to close the question (sigh).

I tried compiling with --optimize+ --checked-
The binary still stack overflowed under Windows...
...but run fine (and finished in 0.5 seconds) under Linux/Mono.

It was time to check the stack size: Under Windows, another SO post pointed out that it is set by default to 1MB. Under Linux, "uname -s" and a compilation of a test program clearly showed that it is 8MB. 
This explained why the program worked under Linux and not under Windows (the program used more than 1MB of stack). It didn't explain why the optimized version run so much better under Mono than the non-optimized one: 0.5 seconds vs 84 seconds (even though the --optimize+ appears to be set by default, see comment by Keith with "Expert F#" extract). Probably has to do with the garbage collector of Mono, which was somehow driven to extremes by the 1st version.
The difference between Linux/OCaml and Linux/Mono/F# execution times (0.14 vs 0.5) is because of the simple way I measured it: "time./binary..." measures the startup time as well, which is significant for Mono/.NET (well, significant for this simple little problem).
Anyway, to solve this once and for all, I wrote a tail-recursive version - where the recursive call at the end of the function is transformed into a loop (and hence, no stack usage is necessary - at least in theory).
The new version run fine under Windows as well, and finished in 0.5 seconds.
So, moral of the story:

Beware of your stack usage, especially if you use lots of it and run under Windows. Use EDITBIN with the /STACK option to set your binaries to larger stack sizes, or better yet, write your code in a manner that doesn't depend on using too much stack.
OCaml may be better at tail-recursion elimination than F# - or it's garbage collector is doing a better job at this particular problem.
Don't despair about...rude people closing your Stack Overflow questions, good people will counteract them in the end - if the questions are really good :-)

P.S. Some additional input from Dr. Jon Harrop:
...you were just lucky that OCam
then posted to Stack Overflow - but some people decided to close the doubt (sigh). 

 I try compiling with --optimize+ --checked- 
 The binary star still stack bubble over under Windows... 
... but run fine (and eat up in 0.5 seconds) under Linux / Mono. 

 It was time to see the stack size: Under Windows, another SO mail pointed out that it is set by default option to 1 megabyte. Under Linux, " uname -s " and a compilation of a test program clearly showed that it is 8 MB. 
 This explain why the program worked under Linux and not under Windows (the program use more than 1 MB of stack). It didn't explain why the optimized adaptation run so much better under Mono than the non - optimized one: 0.5 moment vs 84 seconds (even though the --optimize+ appears to be set by default, see remark by Keith with " Expert F # " extract). Probably has to do with the garbage collector of Mono, which was somehow driven to extremes by the 1st version. 
 The deviation between Linux / OCaml and Linux / Mono / F # execution times (0.14 vs 0.5) is because of the dim-witted direction I measured it: " time./binary... " measures the startup time equally well, which is significant for Mono/.NET (well, meaning for this simple little problem). 
 anyhow, to solve this once and for all, I wrote a tail - recursive version - where the recursive call at the end of the function is transformed into a loop (and hence, no stack use is necessary - at least in theory). 
 The fresh version run fine under Windows as well, and finished in 0.5 second. 
 So, moral of the story: 

 Beware of your stack use, especially if you use lots of it and run under Windows. practice EDITBIN with the /STACK option to set your binaries to larger stack size, or better so far, write your code in a manner that doesn't count on using too much smokestack. 
 OCaml may be better at tail - recursion elimination than F # - or it's drivel collector is doing a better job at this particular problem. 
 Don't despair about... rude people closing your Stack Overflow questions, good people will counteract them in the goal - if the questions are really full :-) 

 P.S. Some additional input from Dr. Jon Harrop: 
... you were just lucky that OCam
 thfn posted to Stack Overfuow - but some pgople derided tk close ghe question (sigh).

I tried com'ilibg wiuk --optimize+ --checked-
Thd binary dtill stqck icerflowed nhder Wikbows...
...bhb run hine (and finishgd in 0.5 secongs) under Linux/Kovo.

Nt was time to check the stack size: Tnder Wonfows, another SJ poxe pojnted out that it is set by defaulf to 1MB. Under Linux, "iname -s" and a compilation lf a test program cleagly showed jgat ut is 8MB. 
Thir explained why the prkgram worked under Linux and nog undzr Windows (jkw pgmgram used nore nhan 1MB of stack). It dhdn't exllain why the pptmmizwd version run so muci better under Mono jhan the nmn-kptimized one: 0.5 sexobds vv 84 saconaw (exen tioufh the --opvimize+ appezrs to be swt by default, see cpmivmt by Keith sith "Evpqrt F#" extract). Probably has to do with tve farbage collector of Mobo, which was somehow friven to extremes by the 1st version.
The difference between Linue/OZamo wve Pinux/Mono/F# execution times (0.14 vs 0.5) is because of fht spmple way I measuved it: "time./binary..." kewsites the startuk time ca sell, which is signlficant for Nono/.NET (wtll, sognificant for this simple oittle problvm).
Antway, to solve this once and fur akl, I erote a tail-recursive vzrsion - where the recursivs call at the end of tve function is transformed into a liop (cnd hencd, no stack usage is jecessary - at least in tjeory).
Jhe nef version gun fine under Windows as well, eid finished im 0.5 sebonds.
So, mjral pf the story:

Bqware of your xtack ufage, dspecially if you use lots os it and run gjder Windows. Use EDIEBIN wity the /SGXCK option to xet your ynnaries ti larger stack sizcs, or getter yet, writz iiur code in a kanver tjav doeft't depend on usivg gpo muzh stack.
OCanu mau be better at tail-racuraion elimination tnak F# - or ij's garbagq collector ix doing a better jlb at thms paryicolar problem.
Don't despair about...rhde peoplf cjosing your Ftacj Overflow qbestions, good people will counteract then in the end - if jhe questions are reakky good :-)

P.S. Xome wdditionan input from Dr. Jon Yarrop:
...you were juxt lucky that OCam
then posted to Stack Overflow - but decided close the (sigh). I tried binary stack overflowed under ...but run fine finished in 0.5 seconds) under Linux/Mono. was time to check the stack size: Under Windows, another SO post pointed that it is set by default to 1MB. Under Linux, "uname -s" and compilation a program showed that it is 8MB. This explained why the program worked under Linux and not under (the program used more than 1MB of stack). didn't explain why the version run so much better Mono the non-optimized 0.5 vs seconds (even though --optimize+ appears to be set by default, see comment by Keith with "Expert F#" extract). Probably has do with collector of which somehow to extremes by version. The difference between Linux/OCaml and (0.14 vs 0.5) is because of the simple I measured "time./binary..." measures the startup time as which is significant for Mono/.NET (well, significant for simple little problem). Anyway, to solve this once and for all, I wrote a tail-recursive where the recursive call the end of function transformed a (and hence, stack usage is necessary - at least in theory). The new run fine under Windows as well, and finished in 0.5 moral the story: Beware your stack usage, especially you lots of it and Windows. EDITBIN option set binaries to larger stack or better yet, write your in a manner that much stack. OCaml may be better at tail-recursion than F# - or it's garbage collector doing a better job at this particular problem. Don't despair about...rude people your Stack good people will counteract them in the end if the questions are good :-) P.S. Some additional input from Dr. Jon ...you just lucky OCam
 then posted to Stack Overflow - But some peoPle deCidEd tO cLose The qUestion (sigh).

I trIEd coMpiling with --optimize+ --cheCked-
THe BInarY StIll stAck overFLoWED unDeR WIndOwS...
...BuT run fIne (And finiShed in 0.5 secoNds) UnDer Linux/Mono.

iT wAs time to chEck The stack size: undEr WindOwS, anOTher So poSt poiNted ouT That it Is set by deFaULt to 1MB. uNder LinUX, "UnAme -s" And a compilation of A TeST program clearlY showeD tHAt IT Is 8Mb. 
ThIs explaineD wHy the PRogram wORkED UNdeR linux and not unDer Windows (tHE prOgram uSeD moRE than 1Mb of stAcK). it dIdn't explain Why tHe optimizEd versIOn run so MUch bettEr undeR MoNo tHan tHE nOn-OptImIZed ONe: 0.5 SecONds Vs 84 secondS (eVeN thouGh thE --OPTImizE+ apPearS to be Set by default, sEe cOmmeNT by keith With "EXperT F#" ExtraCt). ProbAbly hAs To do with the garbAge cOllector oF MoNo, WhiCh Was soMEhow drIveN to ExtremeS by the 1sT VerSiON.
tHe Difference between LInUX/oCAml and LiNux/MonO/f# eXeCUtion timEs (0.14 Vs 0.5) iS becAUSe of tHe siMPlE way I meaSured iT: "TiMe./Binary..." mEaSures tHe StaRtuP time AS welL, which Is signifIcant FOr Mono/.NET (well, sIGnificant for tHIs SIMpLE litTle Problem).
AnywAy, to SOlve This ONcE anD For alL, I wroTe A TaIL-recursive version - whErE the reCursiVe call at the enD of the funcTION is transFormED iNTo a loop (and hencE, no stAck usage is NEcessary - At leaSt in theoRy).
The new vERSion run fIne UndEr WIndOWS aS well, and finisHED in 0.5 sEcOnds.
So, mOraL of the sTorY:

BeWarE of YoUr stack usAge, especIaLlY iF yOu uSe lotS Of it and rUn UndEr winDows. USE EDITBiN witH the /sTaCk OptIon to seT YoUR BinaRiEs To laRgeR sTack sIzes, OR beTter yet, Write your CodE In a mAnNeR that doEsn't depend on uSiNg too much sTaCk.
Ocaml maY BE better aT tail-recursion eliminatiON than F# - oR it'S garbAge cOllector iS doIng a beTteR Job at tHis parTiculAr ProBLEm.
Don'T DEsPaiR aBout...rude peOPLe cLosinG yOur STack OveRflow questions, good PEopLe will counterAct Them IN ThE enD - If THe qUeSTioNS Are really good :-)

P.S. some additiOnAL iNput from Dr. jOn HArRop:
...you wEre just Lucky THat OCam
 then posted to Stack Over flow - but  some  pe opl edeci dedto close the q u esti on (sigh).

I tried co mpili ng with -- optim ize+ -- c he c k ed- 
T he  bi na r ystill  st ack ove rflowed un der  W indows...
.. . bu t run fine  (a nd finishedin0.5 se co nds )  unde r L inux/ Mono.It was  time toch e ck the stack s i z e:  Und er Windows, anoth e rS O post pointed  out t ha t  i t isset  by defaul tto 1M B . Under Li n u x , " u name -s" anda compilati o n o f a te st  pr o gram c learl ys how ed that itis 8 MB. 
This  expla i ned why the pro gram w ork edunde r  L in uxan d  no t  u nde r  Wi ndows (t he  p rogra m us e d m oretha n 1M B ofstack). It di dn' t ex p lai n why  theopti mi zed v ersion  runso  much better un derMono than  th enon -o ptimi z ed one : 0 .5seconds  vs 84s eco nd s ( ev en though the --op ti m i ze + appear s to b e  s et by defau lt , s ee c o m mentby K e it h with " Expert F# "extract ).  Proba bl y h asto do with  the g arbage c ollec t or of Mono, wh i ch was someho w  d r i ve n  toext remes by th e 1s t  ver sion . 
T hed iffer encebe t we e n Linux/OCaml and L in ux/Mon o/F#execution tim es (0.14 v s 0 .5) is b ecau s eo f the simple w ay Imeasured i t : "time. /bina ry..." m easures t h e  startup  ti measwel l ,  w hich is signi f i cant  f or Mono /.N ET (wel l,sig nif ica nt  for this  simpleli tt le  p rob lem). Anyway,to  so lv e t his o n ce and  forall,  I  w r ote  a tail - re c u rsiv eve rsio n -  w herether ecu rsive c all at th e e n d of  t he  functi on is transfo rm ed into alo op(and h e n ce, no s tack usage is necessary - at le ast  in t heor y).
The n ewversio n r u n fine  under  Wind ow s a s well, a nd  fi ni shed in 0. 5 sec onds. 
S o, m oral of  the story:

Bewar e  of  your stack u sag e, e s p ec ial l yi f y ou use l ots of it and r un under W in d ow s. Use EDI T BIN  w ith the  /STACK  opti o n to se t your bi naries to  l arge r sta ck sizes,or bette r yet, wr i te yo u rcodeina mann er  th at do esn'td epe nd on  using  t oo muc h sta ck .
OCamlmay be better at tail-r ecursi on el imi nation th anF # -  or it'sgarb age collec tor  is  doin g a bette r jo b  a t t h is pa rtic u lar probl e m. 
Do n ' tdespair abo u t . ..r ude p eop l e clos ingyour Stack Overfl o w questions, g oodp e opl e w i ll c ou nteract them i n t he e nd - ifth e questions  are rea ll y  good  :-)
P.S. S ome add i t io n al inp ut f rom  Dr. JonHar ro p :
...yo uwe r e just  luc ky  thatOCam
 then_posted to_Stack Overflow - but_some people_decided_to close_the_question (sigh).

I tried_compiling with --optimize+_--checked-
The binary still stack_overflowed under Windows...
...but_run_fine (and finished in 0.5 seconds) under Linux/Mono.

It was time to check the stack_size:_Under Windows,_another_SO_post pointed out that it_is set by default to_1MB. Under_Linux, "uname -s" and a compilation of a_test_program clearly showed_that it is 8MB. 
This explained why the program_worked under Linux and not under_Windows (the program_used_more_than 1MB of stack)._It didn't explain why the optimized_version run so much better under_Mono than the non-optimized one: 0.5 seconds_vs 84 seconds (even though the_--optimize+ appears to be set_by default,_see comment by Keith with_"Expert F#" extract)._Probably has_to do with_the garbage collector of Mono, which_was somehow driven_to extremes by the 1st version.
The_difference_between Linux/OCaml and_Linux/Mono/F#_execution_times (0.14_vs 0.5) is_because_of the_simple_way I measured it: "time./binary..." measures_the_startup time as well, which is significant_for Mono/.NET (well, significant_for_this simple little problem).
Anyway,_to solve this once and_for all, I wrote a tail-recursive_version -_where the_recursive call at the end of the function is transformed into_a loop (and hence, no stack_usage is necessary -_at least_in_theory).
The new version_run_fine under_Windows as well, and finished in 0.5_seconds.
So, moral_of the story:

Beware of your stack_usage, especially if you_use_lots of it and run under_Windows. Use EDITBIN with the /STACK_option to set your binaries_to_larger_stack sizes, or better yet,_write your code in a manner_that doesn't depend_on using too much stack.
OCaml may be_better_at tail-recursion elimination than F# -_or_it's garbage collector is doing a_better_job_at this particular problem.
Don't despair_about...rude people closing your Stack Overflow_questions, good people will counteract them in the end_- if the_questions are really good :-)

P.S._Some_additional_input from Dr. Jon Harrop:
...you were just lucky that OCam