2

The Ackerman function is defined as follows:

$$A(m,n)= \begin{cases} n+1,& m= 1\\ A(m-1,1), & m>0, n=0\\ A(m-1, A(m,n-1)), &m,n>0 \end{cases}$$

Is it possible to get the last few digits of Ackermann function?


I refer to the method in this article: Is this the correct way to compute the last $n$ digits of Graham's number?

If the iterations are large enough, the last 10 digits will be fixed at 3432948733.

But in many cases the number of iterations of the function is not so large.

Is there a more suitable algorithm to deal with the case of Ackerman function?

RobPratt
  • 50,938
Aster
  • 1,315

2 Answers2

1

The Ackermann function is known to have the form

$$A(m,n)=2\uparrow^{m-2}(n+3)-3$$

to which the problem boils down in largely the same manner to finding the eventual last digits of

$$2\uparrow^2k$$

for large $k$ in much the same manner as the provided link, though you will have to take care of the fact that $2$ and $10$ are not relatively prime. A direct computation shows that the last $n$ digits of this should remain constant for $k\ge n+2$.

When the arguments are sufficiently small, then a more direct computation can be used instead.

-2

Exact Value of ( A(4, 2) ):

Through recursive computation: $$A(4, 2) = 2^{2^{2^{65536}}} - 3$$

This is a power tower of $65536$ twos.

Finding the Last Digits

To compute the last digits of such a large number, modular arithmetic can be used.

Last Digit:

The last digit of ( 2^k ) follows a repeating cycle of 4: ( 2, 4, 8, 6 ).

  • The exponent ( 2^{2^{65536}} \mod 4 = 0 ) (since ( 2^k ) for ( k \geq 2 ) is divisible by 4).
  • So, ( 2^{2^{2^{65536}}} \mod 10 = 6 ).
  • Subtracting 3 gives the last digit: ( 6 - 3 = 3 ).

Last Two Digits:

For ( 2^k \mod 100 ), the sequence repeats every 20:

  • ( 2^{2^{65536}} \mod 20 = 16 ) (as ( 2^4 = 16 \mod 20 )).
  • Now compute ( 2^{16} \mod 100 ): Using successive squaring, ( 2^{16} \equiv 76 \mod 100 ).
  • Subtracting 3 gives the last two digits: ( 76 - 3 = 73 ).

Final Answer:

  • Last digit: 3
  • Last two digits: 73
Dominique
  • 3,267
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Nov 27 '24 at 06:17