当前位置:网站首页>Excel cell formula - realize Ackerman function calculation
Excel cell formula - realize Ackerman function calculation
2022-07-24 04:31:00 【Unconquerable&Llxy】
Catalog
One · brief introduction
Ackermann function (ACKERMANN)
Ackermann function (Ackermann) Is an example of a non primitive recursive function . It requires two natural numbers as input values , Output a natural number . Its output value grows very fast , Only for (4,3) The output of is too large to be calculated accurately .
Roughly realized :【 Pseudo code 】
func Ackermann(m,n){
if m=0 -> return n+1;
else if n=0 -> return Ackermann(m-1,1);
else -> return Ackermann(m-1,Ackermann(m,n-1));
}That's about it , Its growth rate is very fast , It can be solved with a two-dimensional table :
notes : Vertical column is m, The horizontal column is n, First act n=0, The first column is m=0
Null value means that it cannot be calculated due to insufficient parameters
| 1 | 2 | 3 | 5 |
| 2 | 3 | 5 | 13 |
| 3 | 4 | 7 | |
| 4 | 5 | 9 | |
| 5 | 6 | 11 | |
| 6 | 7 | 13 | |
| 7 | 8 | 15 | |
| 8 | 9 | 17 | |
| 9 | 10 | 19 | |
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | 15 | ||
| 15 | 16 | ||
| 16 | 17 | ||
| 17 | 18 | ||
| 18 | 19 | ||
| 19 | 20 | ||
| 20 |
Two · Program
The whole program
Slide right to see the complete program
=IF(IF(COLUMN()=1,ROW(),IF(ROW()=1,INDIRECT(ADDRESS(2,COLUMN()-1)),INDIRECT(ADDRESS(INDIRECT(ADDRESS(ROW()-1,COLUMN()))+1,COLUMN()-1))))=0,"",IF(COLUMN()=1,ROW(),IF(ROW()=1,INDIRECT(ADDRESS(2,COLUMN()-1)),INDIRECT(ADDRESS(INDIRECT(ADDRESS(ROW()-1,COLUMN()))+1,COLUMN()-1)))))Program parsing
first IF Indicates whether the judgment result is 0; if 0( The minimum is 1) It means that it cannot be calculated , Fill with "", Empty cell ( Filling in others will cause errors in secondary calculation ).
This is the main calculation :
IF(COLUMN()=1,ROW(),IF(ROW()=1,INDIRECT(ADDRESS(2,COLUMN()-1)),INDIRECT(ADDRESS(INDIRECT(ADDRESS(ROW()-1,COLUMN()))+1,COLUMN()-1))))the second IF If the column number is 1( Starts 1), said m=0, Then the result is line number plus 1.
Here's an explanation , because Excel The row and column number starts with 1, Our table starts with 0, It means that all row and column numbers are larger than they should be 1.
rest
IF(ROW()=1,INDIRECT(ADDRESS(2,COLUMN()-1)),INDIRECT(ADDRESS(INDIRECT(ADDRESS(ROW()-1,COLUMN()))+1,COLUMN()-1)))The next judgment is whether the line number is 1, If yes, execute :
INDIRECT(ADDRESS(2,COLUMN()-1))ADDRESS Represents the coordinate corresponding to the row and column number .INDIRECT obtain ADDRESS Value . It is expressed as the second ( Line mark -1) The value of the column .
If not, execute :
INDIRECT(ADDRESS(INDIRECT(ADDRESS(ROW()-1,COLUMN()))+1,COLUMN()-1))Said to get ( The first ( Column mark ) In the column ( Line mark -1) It's worth it +1 Mark the new line ,( Column mark -1) Label the new column ) Value .
3、 ... and · Usage method
Copy the program to A1 grid , The drop-down cells are copied to A List the grid you want ;
Select the entire A Column , Right click to copy to the column you want .
The next step is Ackermann Table of function values .
( It is possible to display a null value after copying , That's because it can't be calculated according to the existing data , Only need to A Just drop down a few more rows of column values )
This is my result :
| 1 | 2 | 3 | 5 | 13 |
| 2 | 3 | 5 | 13 | |
| 3 | 4 | 7 | 29 | |
| 4 | 5 | 9 | 61 | |
| 5 | 6 | 11 | 125 | |
| 6 | 7 | 13 | ||
| 7 | 8 | 15 | ||
| 8 | 9 | 17 | ||
| 9 | 10 | 19 | ||
| 10 | 11 | 21 | ||
| 11 | 12 | 23 | ||
| 12 | 13 | 25 | ||
| 13 | 14 | 27 | ||
| 14 | 15 | 29 | ||
| 15 | 16 | 31 | ||
| 16 | 17 | 33 | ||
| 17 | 18 | 35 | ||
| 18 | 19 | 37 | ||
| 19 | 20 | 39 | ||
| 20 | 21 | 41 | ||
| 21 | 22 | 43 | ||
| 22 | 23 | 45 | ||
| 23 | 24 | 47 | ||
| 24 | 25 | 49 | ||
| 25 | 26 | 51 | ||
| 26 | 27 | 53 | ||
| 27 | 28 | 55 | ||
| 28 | 29 | 57 | ||
| 29 | 30 | 59 | ||
| 30 | 31 | 61 | ||
| 31 | 32 | 63 | ||
| 32 | 33 | 65 | ||
| 33 | 34 | 67 | ||
| 34 | 35 | 69 | ||
| 35 | 36 | 71 | ||
| 36 | 37 | 73 | ||
| 37 | 38 | 75 | ||
| 38 | 39 | 77 | ||
| 39 | 40 | 79 | ||
| 40 | 41 | 81 | ||
| 41 | 42 | 83 | ||
| 42 | 43 | 85 | ||
| 43 | 44 | 87 | ||
| 44 | 45 | 89 | ||
| 45 | 46 | 91 | ||
| 46 | 47 | 93 | ||
| 47 | 48 | 95 | ||
| 48 | 49 | 97 | ||
| 49 | 50 | 99 | ||
| 50 | 51 | 101 | ||
| 51 | 52 | 103 | ||
| 52 | 53 | 105 | ||
| 53 | 54 | 107 | ||
| 54 | 55 | 109 | ||
| 55 | 56 | 111 | ||
| 56 | 57 | 113 | ||
| 57 | 58 | 115 | ||
| 58 | 59 | 117 | ||
| 59 | 60 | 119 | ||
| 60 | 61 | 121 | ||
| 61 | 62 | 123 | ||
| 62 | 63 | 125 | ||
| 63 | 64 | 127 | ||
| 64 | 65 | 129 | ||
| 65 | 66 | 131 | ||
| 66 | 67 | 133 | ||
| 67 | 68 | 135 | ||
| 68 | 69 | 137 | ||
| 69 | 70 | 139 | ||
| 70 | 71 | 141 | ||
| 71 | 72 | 143 | ||
| 72 | 73 | 145 | ||
| 73 | 74 | 147 | ||
| 74 | 75 | 149 | ||
| 75 | 76 | 151 | ||
| 76 | 77 | 153 | ||
| 77 | 78 | 155 | ||
| 78 | 79 | 157 | ||
| 79 | 80 | 159 | ||
| 80 | 81 | 161 | ||
| 81 | 82 | |||
| 82 | 83 | |||
| 83 | 84 | |||
| 84 | 85 | |||
| 85 | 86 | |||
| 86 | 87 | |||
| 87 | 88 | |||
| 88 | 89 | |||
| 89 | 90 | |||
| 90 | 91 | |||
| 91 | 92 | |||
| 92 | 93 | |||
| 93 | 94 | |||
| 94 | 95 | |||
| 95 | 96 | |||
| 96 | 97 | |||
| 97 | 98 | |||
| 98 | 99 | |||
| 99 | 100 | |||
| 100 | 101 | |||
| 101 | 102 | |||
| 102 | 103 | |||
| 103 | 104 | |||
| 104 | 105 | |||
| 105 | 106 | |||
| 106 | 107 | |||
| 107 | 108 | |||
| 108 | 109 | |||
| 109 | 110 | |||
| 110 | 111 | |||
| 111 | 112 | |||
| 112 | 113 | |||
| 113 | 114 | |||
| 114 | 115 | |||
| 115 | 116 | |||
| 116 | 117 | |||
| 117 | 118 | |||
| 118 | 119 | |||
| 119 | 120 | |||
| 120 | 121 | |||
| 121 | 122 | |||
| 122 | 123 | |||
| 123 | 124 | |||
| 124 | 125 | |||
| 125 | 126 | |||
| 126 | 127 | |||
| 127 | 128 | |||
| 128 | 129 | |||
| 129 | 130 | |||
| 130 | 131 | |||
| 131 | 132 | |||
| 132 | 133 | |||
| 133 | 134 | |||
| 134 | 135 | |||
| 135 | 136 | |||
| 136 | 137 | |||
| 137 | 138 | |||
| 138 | 139 | |||
| 139 | 140 | |||
| 140 | 141 | |||
| 141 | 142 | |||
| 142 | 143 | |||
| 143 | 144 | |||
| 144 | 145 | |||
| 145 | 146 | |||
| 146 | 147 | |||
| 147 | 148 | |||
| 148 | 149 | |||
| 149 | 150 | |||
| 150 | 151 | |||
| 151 | 152 | |||
| 152 | 153 | |||
| 153 | 154 | |||
| 154 | 155 | |||
| 155 | 156 | |||
| 156 | 157 | |||
| 157 | 158 | |||
| 158 | 159 | |||
| 159 | 160 | |||
| 160 | 161 | |||
| 161 |
边栏推荐
- dispatch_ Once's Secret
- Embedded system transplantation [6] - uboot source code structure
- What if the references in the word sent by others are {} in such a garbled format
- [hope to answer] the data cannot be synchronized correctly
- [JS] save the string as a file to the local (.Txt,.Json,.Md...)
- Codeforces Round #809 (Div. 2) A - D1
- Game improvement of smart people: Chapter 3 Lesson 3: find game
- Particle Designer:粒子效果制作器,生成plist文件并在工程中正常使用
- 别人发的word中的参考文献是{}这样的乱码格式怎么办
- [untitled]
猜你喜欢

Basic syntax of MySQL DDL and DML and DQL
![Embedded system transplantation [6] - uboot source code structure](/img/dd/85e56360b08f49562a28ea6f6adcfd.png)
Embedded system transplantation [6] - uboot source code structure

Iqoo 10 series attacks originos original system to enhance mobile phone experience

PostgreSQL source code learning (32) -- checkpoint ④ - core function createcheckpoint

一次线上事故,我顿悟了异步的精髓

What new opportunities exist in the short video local life section?

仿今日头条实时新闻微信小程序项目源码

postgresql源码学习(32)—— 检查点④-核心函数CreateCheckPoint

Clickpaas, a low code service provider, has completed a strategic merger with BiP technology to jointly build an industrial digital base

From bio to realizing the function of simple multi person chat room -- IO model
随机推荐
Billiard simulator based on the integration of GL pipeline and ray tracing technology
Will your NFT disappear? Dfinity provides the best solution for NFT storage
[C language] program environment and preprocessing operation
C language classic exercises
Educational Codeforces Round 132 A - D
00cm non, make sure to go online with the business party once in advance, and make everything better
May be a little useful cold knowledge
Design of high frequency small signal resonant amplifier course design Multisim Simulation
Pyth deinitialization averages on many machine decision boundaries, starting on the bus
高频小信号谐振放大器设计-课程设计Multisim仿真
Robustness evaluation of commercial in vivo detection platform
PMIX ERROR: ERROR in file gds_ds12_lock_pthread.c
NFT insider 67: Barcelona Football Club launched its first NFT work, and Dubai launched the national metauniverse strategy
ECB interface is also mdsemodet in essence
buu web
【望解答】数据无法正确同步了
Shell语法(一)
C语言经典习题之猴子吃桃问题
C语言:选择排序法
What if the references in the word sent by others are {} in such a garbled format