# project-euler/188/euler-188-notes.txt

+The hyperexponentiation or tetration of a number a by a positive integer b, denoted by a↑↑b or ba, is recursively defined by:

+Thus we have e.g. 3↑↑2 = 33 = 27, hence 3↑↑3 = 327 = 7625597484987 and 3↑↑4 is roughly 103.6383346400240996*10^12.

+Find the last 8 digits of 1777↑↑1855.

+We are interested in 1777 ** (1777 ↑↑ 1854) % 1e8 . Now, (1777 ** n % 1e8)

+has a cycle, because for some n, ( (1777 ** n) % 1e8 ) == 1. Let's call this

+Now we are interested in (1777 ↑↑ 1854) % $m. This is

+1777 ** (1777 ↑↑ 1853) % $m . This too has a cycle which we'll call $t ,

+so we check 1777 ** (1777 ↑↑ 1852) % $t, and so on.