McCarthy 91 function

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

"The McCarthy 91 function is a recursive function, defined by the computer scientist John McCarthy as a test case for formal verification within computer science."

The McCarthy 91 function is defined as:

M(n) = n-10, if n > 100
= M(M(n+11)), if n <= 100

http://en.wikipedia.org/wiki/McCarthy_91_function

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

99

Sample output:

M(99)
M(M(110))
M(100)
M(M(111))
M(101)
91

Sample input:_

87

Sample output:

M(87)
M(M(98))
M(M(M(109)))
M(M(99))
M(M(M(110)))
M(M(100))
M(M(M(111)))
M(M(101))
M(91)
M(M(102))
M(92)
M(M(103))
M(93)
M(M(104))
M(94)
M(M(105))
M(95)
M(M(106))
M(96)
M(M(107))
M(97)
M(M(108))
M(98)
M(M(109))
M(99)
M(M(110))
M(100)
M(M(111))
M(101)
91

Sample input:_

1

Sample output:

M(1)
M(M(12))
M(M(M(23)))
M(M(M(M(34))))
M(M(M(M(M(45)))))
M(M(M(M(M(M(56))))))
M(M(M(M(M(M(M(67)))))))
M(M(M(M(M(M(M(M(78))))))))
M(M(M(M(M(M(M(M(M(89)))))))))
M(M(M(M(M(M(M(M(M(M(100))))))))))
M(M(M(M(M(M(M(M(M(M(M(111)))))))))))
M(M(M(M(M(M(M(M(M(M(101))))))))))
M(M(M(M(M(M(M(M(M(91)))))))))
M(M(M(M(M(M(M(M(M(M(102))))))))))
M(M(M(M(M(M(M(M(M(92)))))))))
M(M(M(M(M(M(M(M(M(M(103))))))))))
M(M(M(M(M(M(M(M(M(93)))))))))
M(M(M(M(M(M(M(M(M(M(104))))))))))
M(M(M(M(M(M(M(M(M(94)))))))))
M(M(M(M(M(M(M(M(M(M(105))))))))))
M(M(M(M(M(M(M(M(M(95)))))))))
M(M(M(M(M(M(M(M(M(M(106))))))))))
M(M(M(M(M(M(M(M(M(96)))))))))
M(M(M(M(M(M(M(M(M(M(107))))))))))
M(M(M(M(M(M(M(M(M(97)))))))))
M(M(M(M(M(M(M(M(M(M(108))))))))))
M(M(M(M(M(M(M(M(M(98)))))))))
M(M(M(M(M(M(M(M(M(M(109))))))))))
M(M(M(M(M(M(M(M(M(99)))))))))
M(M(M(M(M(M(M(M(M(M(110))))))))))
M(M(M(M(M(M(M(M(M(100)))))))))
M(M(M(M(M(M(M(M(M(M(111))))))))))
M(M(M(M(M(M(M(M(M(101)))))))))
M(M(M(M(M(M(M(M(91))))))))
M(M(M(M(M(M(M(M(M(102)))))))))
M(M(M(M(M(M(M(M(92))))))))
M(M(M(M(M(M(M(M(M(103)))))))))
M(M(M(M(M(M(M(M(93))))))))
M(M(M(M(M(M(M(M(M(104)))))))))
M(M(M(M(M(M(M(M(94))))))))
M(M(M(M(M(M(M(M(M(105)))))))))
M(M(M(M(M(M(M(M(95))))))))
M(M(M(M(M(M(M(M(M(106)))))))))
M(M(M(M(M(M(M(M(96))))))))
M(M(M(M(M(M(M(M(M(107)))))))))
M(M(M(M(M(M(M(M(97))))))))
M(M(M(M(M(M(M(M(M(108)))))))))
M(M(M(M(M(M(M(M(98))))))))
M(M(M(M(M(M(M(M(M(109)))))))))
M(M(M(M(M(M(M(M(99))))))))
M(M(M(M(M(M(M(M(M(110)))))))))
M(M(M(M(M(M(M(M(100))))))))
M(M(M(M(M(M(M(M(M(111)))))))))
M(M(M(M(M(M(M(M(101))))))))
M(M(M(M(M(M(M(91)))))))
M(M(M(M(M(M(M(M(102))))))))
M(M(M(M(M(M(M(92)))))))
M(M(M(M(M(M(M(M(103))))))))
M(M(M(M(M(M(M(93)))))))
M(M(M(M(M(M(M(M(104))))))))
M(M(M(M(M(M(M(94)))))))
M(M(M(M(M(M(M(M(105))))))))
M(M(M(M(M(M(M(95)))))))
M(M(M(M(M(M(M(M(106))))))))
M(M(M(M(M(M(M(96)))))))
M(M(M(M(M(M(M(M(107))))))))
M(M(M(M(M(M(M(97)))))))
M(M(M(M(M(M(M(M(108))))))))
M(M(M(M(M(M(M(98)))))))
M(M(M(M(M(M(M(M(109))))))))
M(M(M(M(M(M(M(99)))))))
M(M(M(M(M(M(M(M(110))))))))
M(M(M(M(M(M(M(100)))))))
M(M(M(M(M(M(M(M(111))))))))
M(M(M(M(M(M(M(101)))))))
M(M(M(M(M(M(91))))))
M(M(M(M(M(M(M(102)))))))
M(M(M(M(M(M(92))))))
M(M(M(M(M(M(M(103)))))))
M(M(M(M(M(M(93))))))
M(M(M(M(M(M(M(104)))))))
M(M(M(M(M(M(94))))))
M(M(M(M(M(M(M(105)))))))
M(M(M(M(M(M(95))))))
M(M(M(M(M(M(M(106)))))))
M(M(M(M(M(M(96))))))
M(M(M(M(M(M(M(107)))))))
M(M(M(M(M(M(97))))))
M(M(M(M(M(M(M(108)))))))
M(M(M(M(M(M(98))))))
M(M(M(M(M(M(M(109)))))))
M(M(M(M(M(M(99))))))
M(M(M(M(M(M(M(110)))))))
M(M(M(M(M(M(100))))))
M(M(M(M(M(M(M(111)))))))
M(M(M(M(M(M(101))))))
M(M(M(M(M(91)))))
M(M(M(M(M(M(102))))))
M(M(M(M(M(92)))))
M(M(M(M(M(M(103))))))
M(M(M(M(M(93)))))
M(M(M(M(M(M(104))))))
M(M(M(M(M(94)))))
M(M(M(M(M(M(105))))))
M(M(M(M(M(95)))))
M(M(M(M(M(M(106))))))
M(M(M(M(M(96)))))
M(M(M(M(M(M(107))))))
M(M(M(M(M(97)))))
M(M(M(M(M(M(108))))))
M(M(M(M(M(98)))))
M(M(M(M(M(M(109))))))
M(M(M(M(M(99)))))
M(M(M(M(M(M(110))))))
M(M(M(M(M(100)))))
M(M(M(M(M(M(111))))))
M(M(M(M(M(101)))))
M(M(M(M(91))))
M(M(M(M(M(102)))))
M(M(M(M(92))))
M(M(M(M(M(103)))))
M(M(M(M(93))))
M(M(M(M(M(104)))))
M(M(M(M(94))))
M(M(M(M(M(105)))))
M(M(M(M(95))))
M(M(M(M(M(106)))))
M(M(M(M(96))))
M(M(M(M(M(107)))))
M(M(M(M(97))))
M(M(M(M(M(108)))))
M(M(M(M(98))))
M(M(M(M(M(109)))))
M(M(M(M(99))))
M(M(M(M(M(110)))))
M(M(M(M(100))))
M(M(M(M(M(111)))))
M(M(M(M(101))))
M(M(M(91)))
M(M(M(M(102))))
M(M(M(92)))
M(M(M(M(103))))
M(M(M(93)))
M(M(M(M(104))))
M(M(M(94)))
M(M(M(M(105))))
M(M(M(95)))
M(M(M(M(106))))
M(M(M(96)))
M(M(M(M(107))))
M(M(M(97)))
M(M(M(M(108))))
M(M(M(98)))
M(M(M(M(109))))
M(M(M(99)))
M(M(M(M(110))))
M(M(M(100)))
M(M(M(M(111))))
M(M(M(101)))
M(M(91))
M(M(M(102)))
M(M(92))
M(M(M(103)))
M(M(93))
M(M(M(104)))
M(M(94))
M(M(M(105)))
M(M(95))
M(M(M(106)))
M(M(96))
M(M(M(107)))
M(M(97))
M(M(M(108)))
M(M(98))
M(M(M(109)))
M(M(99))
M(M(M(110)))
M(M(100))
M(M(M(111)))
M(M(101))
M(91)
M(M(102))
M(92)
M(M(103))
M(93)
M(M(104))
M(94)
M(M(105))
M(95)
M(M(106))
M(96)
M(M(107))
M(97)
M(M(108))
M(98)
M(M(109))
M(99)
M(M(110))
M(100)
M(M(111))
M(101)
91

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid680.03962014/11/13 10:52:300B / 31B / 34B
2mitchs700.02852014/11/13 07:04:440B / 35B / 33B
3jpl900.04062014/11/14 01:00:230B / ?B / ?B
4mitchs (leonid)670.04942014/11/26 19:20:050B / 31B / 33B

Perl _

RankUserSizeTimeDateStatistics
1tails630.03262014/11/12 23:41:200B / 25B / 38B
2teebee630.03332014/11/15 09:07:460B / 26B / 37B
3brx670.03442014/11/26 08:51:590B / 21B / 46B
4BioFALSE940.03992014/11/30 20:45:480B / 39B / 53B

Python _

RankUserSizeTimeDateStatistics
1whatisgolf700.09892014/11/19 05:41:350B / ?B / ?B
2llhuii700.09332014/11/25 23:08:470B / 36B / 33B
3leonid700.09262014/11/26 04:18:440B / 37B / 30B
4mitchs720.08852014/11/13 07:04:340B / 38B / 31B
5rolf920.09392014/11/13 07:53:100B / 50B / 30B

Scheme _

RankUserSizeTimeDateStatistics
1kaki1160.23042014/11/26 16:45:320B / 48B / 59B
2frob3210.05202014/12/04 00:10:590B / 93B / 74B

JavaScript _

RankUserSizeTimeDateStatistics
1Haaroth2020.05012014/11/26 02:01:430B / 110B / 89B
2aaa2610.04492014/11/26 01:54:270B / ?B / ?B
3FizzyTea1050.06432014/12/02 09:58:150B / 53B / 52B

Lua _

RankUserSizeTimeDateStatistics
1AndoDaan2250.03712014/11/12 18:22:210B / 115B / 73B

C _

RankUserSizeTimeDateStatistics
1llhuii1130.03262014/11/22 13:45:390B / 49B / 64B

OCaml _

RankUserSizeTimeDateStatistics
1hebiyan5060.08422014/11/21 12:55:220B / ?B / ?B

Haskell _

RankUserSizeTimeDateStatistics
1henkma960.04282014/11/26 17:21:090B / 53B / 36B
2int-e970.03942014/11/25 21:30:450B / 50B / 41B
3oerjan1210.03762014/11/13 10:20:490B / 54B / 62B

AWK _

RankUserSizeTimeDateStatistics
1llhuii740.03232014/11/23 11:48:050B / 33B / 40B

dc _

RankUserSizeTimeDateStatistics
1tails720.06402014/11/13 02:59:170B / 53B / 19B

xgawk _

RankUserSizeTimeDateStatistics
1llhuii740.03362014/11/22 01:00:440B / 33B / 40B

GolfScript _

RankUserSizeTimeDateStatistics
1tails450.10292014/11/13 00:42:580B / 16B / 29B

Language Ranking_

RankLangUserSizeScore
1GolfScripttails4510000
2Perltails637142
3Rubymitchs (leonid)676716
4Pythonwhatisgolf706428
5dctails726250
6xgawkllhuii746081
7AWKllhuii746081
8Haskellhenkma964687
9JavaScriptFizzyTea1054285
10Cllhuii1133982
11Schemekaki1163879
12LuaAndoDaan2252000
13OCamlhebiyan506889

return top