从哥德尔代码转换为文本 [英] Converting from Gödel code to text
问题描述
我做了哥德尔的加密软件,但我面临的一个问题。
加密后如何获得代码?例如,对于符号 0
哥德尔数为6,对符号的哥德尔数 =
5。因此,在他们的系统,公式 0 = 0
的哥德尔数为2 ^ 6×3 ^ 5×5 ^ 6 = 2.43亿。
I am doing a Gödel encryption software, but I am facing a problem.
How to get the code after encrypting it? For example, the Gödel number for the symbol 0
is 6 and the Gödel number for the symbol =
is 5. Thus, in their system, the Gödel number of the formula 0 = 0
is 2^6 × 3^5 × 5^6 = 243,000,000.
注:2 ^ 6指2功率6
Note: 2^6 means 2 in power 6.
//need to make 5+6
int equalsign = 5;
int n5 = 2;
int n6 = 59;
int final;
//do caluclations
final = (Math.Pow(2, 2) * Math.Pow (3, 5) * Math.Pow(5, 59));
Console.WriteLine(final);
如何让 0 = 0
从2.43亿?我有这样的问题,任何建议如何使或代码?
How to get the 0 = 0
from 243,000,000? I am having problems with this, any suggestion how to make it or for the code?
final = (Math.Pow(2, 2) * Math.Pow (3, 5) * Math.Pow(5, 59));
这不太正常工作。 ?什么办法如何解决这个问题,以及
This does not work too. Any way how to fix this as well?
这是哥德尔公式:
的图片1
推荐答案
的总体思路是不断分裂次数最后
当前素数p,只要它是由对均匀divisble。你可以通过各主要平均分配的次数给你的权力
The general idea is to keep dividing the number final
by the current prime p so long as it is evenly divisble by p. The number of times you can divide evenly by each prime gives you the powers.
粗略地讲,你正在寻找的东西像下面的伪代码:
roughly speaking you're looking for something like the following pseudocode:
code = []
for each prime p:
c = 0
while final % p == 0:
c++
final = final / p
code.append(c)
这篇关于从哥德尔代码转换为文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!