Write a program to perform the four basic arithmetic operations, +, –, ·, and /, on very large integers; the result of division should also be an integer. Apply these operations to compute 12345, or the hundredth number in the sequence 1 * 2 + 3, 2 * 32 + 4, 3 * 43 + 5, . . . . Also apply them to compute the Gödel numbers of arithmetical expressions.
The Gödel numbering function GN first establishes a correspondence between basic elements of language and numbers:
Symbol | Gödel Number GN |
= | 1 |
+ | 2 |
* | 3 |
– | 4 |
/ | 5 |
( | 6 |
) | 7 |
^ | 8 |
0 | 9 |
S | 10 |
xi | 11 + 2 * i |
Xi | 12 + 2 * i |
where S is the successor function. Then, for any formula F = s1s2 … sn:
GN(´s1s2 . . . sn´) = 2GN(s1) * 3GN(s2) * … * pnGN(sn)
where pn is the nth prime. For example,
GN(1) = GN(S0) = 210 * 39
and
GN(´x1 + x3 = x4´) = 211+2 * 32 * 511+6 * 71 * 1111+8
In this way, every arithmetic expression can be assigned a unique number. This method has been used by Gödel to prove theorems, known as Gödel’s theorems, which are of extreme importance for the foundations of mathematics.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.