理论上输出格雷厄姆数
格雷厄姆的电话号码G是这样定义的: u(3,n,1) = 3^n u(3,1,m) = 3 u(3,n,m) = u(3,u(3,n-1,m),m-1) [Knuth's up-arrow notation] [Conway chained arrow notation] THEN g1 = u(3,3,4) g2 = u(3,3,g1) g3 = u(3,3,g2) ... G = u(3,3,g63) 您将得到u(3,3,2)=7625597484987检查代码的信息。 您的任务是编写一个程序/函数G,如果有足够的整数大小和足够的时间,它将确定性地输出值。 参考文献 格雷厄姆的电话 Knuth的向上箭头表示法 Conway链式箭头符号 排行榜 显示代码段 var QUESTION_ID=83873,OVERRIDE_USER=48934;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var …