arXiv:cs/9301113v1 [cs.CC] 1 Aug 1991 etoe na es 4pgso oa an’ elkontex known well Manna’s Zohar of pages putation 14 least at on mentioned enivsiae xesvl tSafr’ Ilaboratory AI Stanford’s at extensively investigated been h olwn ucin(e 6 rbe 5–8]): Problem [6, (see function following the thdtettlyuepce 9 property.” “91 unexpected totally w the he had definition, properti it the whose studying recursion After simple induction. a mathematical study to wanted he because itdyi h 4h.MCrh rgnlywoedw h de the down wrote comp originally a McCarthy because (and 64th). birthday the 64th is McCarthy’s birthday John of function. year the 91 The q difficult quite 1. to lead prob can open recursions few simple A extremely theorems that systems. the verification of automated Several for material functions. related closely several ucin[3 satil recursion triple a is [13] function hymk xeln xmlsfrtxbosta ics rec discuss that textbooks for examples verifying excellent of task make the t they consider because we when instructive recu arise quite such that of are techniques out is functions carry both functions to Yet these want problem. ever of would Neither programmer reasonable remembered). times of not number large are a values expanded been has system definition Lisp the of after testing benchmark for useful proved has which a eoekona h 9 ucin”snei un u that out turns it since function,” “91 the as known become has xlrn h rpriso eusv rgas McCarthy’ programs. recursive of properties the exploring h 1fnto etil eog otesto infiatte significant of set the to belongs certainly function 91 The nta fuigMCrh’ rgnldfiiin e’ chan let’s definition, original McCarthy’s using of Instead h ups fti ae st bannwifrainabout information new obtain to is paper this of purpose The onMCrh n koTkuh nrdcditrsigrec interesting introduced Takeuchi Ikuo and McCarthy John question open intriguing some and verification, pr machine are theorems for Several recursion. triple Takeuchi’s to and Abstract 6.Tefis ulse icsin ftefnto appeare function the of discussions published first The [6]. t ( edsuspoete frcrieshmsrltdt McCa to related schemas recursive of properties discuss We . ,y z y, x, = ) if f f ti prpit obgnb tdigte9 ucin becau function, 91 the studying by begin to appropriate is It x ( ( x ≤ x = ) = ) y etokEape fRecursion of Examples Textbook then if if > x > x y else yDnl .Knuth E. Donald by 100 100 then then t t ( x 1 x − x − − 1 ,z y, , 10 10 else else ) t , uig16 [8]. 1968 during ucin[7] function s rvdblwsol rvd odtest good provide should below proved optrporm omly Therefore formally. programs computer spesnl upie odsoe that discover to surprised pleasantly as e lutaeipratpolm and problems important illustrate hey only terminates recursion the because s ( ursion. uestions. eteseictosabtadconsider and bit a specifications the ge f y f f scudntb eue yordinary by deduced be not could es psda neetn candidates interesting as oposed asmn htpeiul computed previously that (assuming esaesae,ilsrtn h fact the illustrating stated, are lems 91 − ( f x r raised. are s ( rcia motne eas no because importance, practical nto of finition ( 1 x sv opttoso realistic a on computations rsive t, 1frall for 91 = ) x ,x z, , tokeape,bcuei is it because examples, xtbook trsinitsms significant most scientist’s uter 901) + rec qain ste were they as equations urrence 11) + ahmtclTer fCom- of Theory Mathematical f n17 7 ] fe thad it after 9], [7, 1970 in d ( ) x t , and ) ( tys“1function” “91 rthy’s z f − ( x x 1 t ,a hw above, shown as ), ( ,y x, , ,y z y, x, ≤ 0.Takeuchi’s 101. ) n about and ) , e19 is 1991 se where f 91(y) stands for f f f(y) , the 91-times-repeated application of f. According · · · · · · to this new definition, we have
f(91) = f 91(992) = f 90(982) = = f 2(102) = f(92) . · · · And a similar derivation shows that if 90 x 100 we have ≤ ≤ f(x)= f 91(x + 901) = = f 2(x + 11) = f(x + 1) ; · · · hence f(90) = f(91) = = f(100) = f(101) . · · · And f(101) = 91, so we have proved in particular that
f(91) = 91 .
Now let’s evaluate f(x) when x is extremely small, say x = 106. We have − f( 1000000) = f 91( 999099) = f 181( 998198) = = f 99811( 791) − − − · · · − = f 99901(110) = f 99900(100) and we know that f(100) = 91; hence
f 99900(100) = f 99899(91) = f 99898(91) = = f(91) = 91 . · · · In general, if x is any integer 100, let m be the smallest integer such that x + 901m> 100, and ≤ let n be the smallest integer such that x + 901m 10n 100. Then m 1, n 91, and − ≤ ≥ ≤ f(x)= f 1+90m(x + 901m)= f 1+90m−n(x + 901m 10n)= f 90m−n(91) , − where the last step follows since 91 x + 901m 10n 100. We conclude that f(x) = 91. (The ≤ − ≤ final step is omitted if m = 1 and n = 91; that case occurs if and only if x = 100.) How many iterations are needed to compute f(x) by this definition, if we continue to apply the recurrence even when evaluating f(x) for values of x that have already been considered? Let F (x) count the number of times that the test ‘if x> 100’ is performed; then we have
F (x)= if x> 100 then 1 else 1+ F (x + 901) + F f(x + 901) + + F f 2(x + 901) + + F f 90(x + 901) . · · · (This is a special case of the general notion of a derived function, which is always jointly recursive with the function from which it has been derived; see McCarthy and Talcott [11].) A bit of experimentation reveals that F (x) also reduces to a simple function:
2 Lemma 1. F (x)= if x> 100 then 1 else 9192 91x. − Proof. If x< 100 we have
90 F (x) F (x +1) = F f k(x + 901) F f k(x + 902) . − − kX=0 Now if x + 901 100, the sum reduces to F (x + 901) F (x + 902), because the terms for k > 0 ≤ − are F f k(x + 901) F f k(x + 902) = F (91) F (91) = 0. In this case we let x′ = x + 901. − − On the other hand if x + 901 > 100, let n be minimal such that x + 901 10n 100. Then − ≤ 1 n 90, and F f k(x + 901) F f k(x + 902) = F (91) F (91) = 0 for all k>n. We also ≤ ≤ − − have F f n(x + 901) F f n(x + 902) = F (x + 901 10n) F (x + 902 10n); and F f k(x + − − − − 902) F f k(x + 901) = 1 1 = 0 for all k