当前位置:网站首页>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 |
边栏推荐
- Privacy protection federal learning framework supporting most irregular users
- From bio to realizing the function of simple multi person chat room -- IO model
- [2023 core technology approval test questions in advance] ~ questions and reference answers
- iPhone手机绑定163邮箱解决方案
- [translation] announce krius -- accelerate your monitoring and adoption of kubernetes
- 可以脱离设据生效这些都是控化部署能力,而后引如
- Particle Designer: particle effect maker, which generates plist files and can be used normally in projects
- [09] program loading: "640K memory" is really not enough?
- 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)
猜你喜欢

What if the references in the word sent by others are {} in such a garbled format
![[untitled]](/img/c1/23797dd628641d524b55a125e95c52.png)
[untitled]

Chapter III query processing of PostgreSQL Guide - Insider exploration

高频小信号谐振放大器设计-课程设计Multisim仿真

From bio to realizing the function of simple multi person chat room -- IO model

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

Nautilus 3.19.2为Gnome增添动力

Can NFT pledge in addition to trading?

Merge sort

Qt5.14_MinGW/MSVC下实现VS2019面板自由拖拽组合功能
随机推荐
C语言经典练习题
The problem of monkeys eating peaches in classic exercises of C language
ARP Spoofing protection of network security
"PostgreSQL guide -- inside exploration" Chapter 2 process and memory architecture
Live video | 37 how to use starrocks to realize user portrait analysis in mobile games
C主机对IIC从来分别设置每足够的话,可下几位
Codeforces Round #807 (Div. 2) A - D
如何用STATA进行chowtest
一次 svchost.exe 进程占用大量网络带宽的排查
Clickpaas, a low code service provider, has completed a strategic merger with BiP technology to jointly build an industrial digital base
Design and implementation of data analysis platform for intelligent commerce
The second anniversary of opengauss' open source, cracking the pain point of database ecology
IP second experiment mGRE OSPF
-Bash: wget: command not found
.gz的业务交互和对外服篇中我们通合多个模型
May be a little useful cold knowledge
Game improvement of smart people: Chapter 3 Lesson 3: find game
Iqoo 10 series attacks originos original system to enhance mobile phone experience
Learn more about the new features of ES6 in grain mall of e-commerce project
致-.-- -..- -