当前位置:网站首页>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 |
边栏推荐
- [essay] goodbye to Internet Explorer, and the mark of an era will disappear
- Export function called separately
- May be a little useful cold knowledge
- PMIX ERROR: ERROR in file gds_ds12_lock_pthread.c
- Insider of LAN SDN hard core technology 22 Kang long regrets -- Specifications and restrictions (Part 2)
- [09] program loading: "640K memory" is really not enough?
- C语言:冒泡排序法
- Go language series - synergy GMP introduction - with ByteDance interpolation
- Game improvement of smart people: Chapter 3 Lesson 3: find game
- 高频小信号谐振放大器设计-课程设计Multisim仿真
猜你喜欢
![Graduation thesis on enterprise production line improvement [Flexsim simulation example]](/img/83/381ef1566d5a863b709f504b46e169.png)
Graduation thesis on enterprise production line improvement [Flexsim simulation example]

Smart contract: release an erc20 token

基于GL Pipeline与光线追踪技术的融合实现的台球模拟器

Chapter III query processing of PostgreSQL Guide - Insider exploration

一次 svchost.exe 进程占用大量网络带宽的排查

The second anniversary of open source, opengauss Developer Day 2022 full highlights review!

Design of two power dividers and directional couplers for basic experiment of microwave technology

Basic syntax of MySQL DDL and DML and DQL

Codeforces Round #807 (Div. 2) A - D
[hope to answer] the data cannot be synchronized correctly
随机推荐
.gz的业务交互和对外服篇中我们通合多个模型
Nautilus 3.19.2为Gnome增添动力
Ambire gas tank launches exclusive NFT launch
Live video | 37 how to use starrocks to realize user portrait analysis in mobile games
数组力扣(持续更新)
These are controlled deployment capabilities, and then cited as
LAN SDN technology hard core insider 9 from software overlay to hardware overlay
Redis sentinel mode, master node check script
Live classroom system 04 create service module
How long has it been since you changed your cell phone?
Write a search box with search tips
《论文复现》BiDAF代码实现过程(3)模型建立
-Bash: wget: command not found
What if Adobe pr2022 doesn't have open subtitles?
Parallel technology of Oracle
J9 number theory: what is Web3.0? What are the characteristics of Web3.0?
Is cross modal semantic alignment optimal under comparative learning--- Adaptive sparse attention alignment mechanism IEEE trans MultiMedia
微波技术基础实验二 功分器与定向耦合器设计
归并排序(Merge sort)
How to perform chowtest with Stata