View Single Post
Old 2005-08-21, 16:11   #9
mpenguin
 
Aug 2005

3·5 Posts
Default

sqrt(2+sqrt(2+sqrt(2+sqrt(2+....sqrt(2))) are computable from Z and iterating x -> x^2 -2 may reach zero in n+1 steps.

mupad code:
Code:
fn:=proc(n) begin 2^(2^n)+1;end_proc;
n0:=7;
n:=fn(n0);
sq2:=mods(fn(n0-1)/(fn(n0-2)-1),n);
mods(sq2^2,n);
vk:=(fn(n0-2)/(2^(2^(n0-3))));
print(" ^2 -sq2[-1] ",1,mods(vk,n),mods(vk^2,n)-sq2);
for i from 2 to n0-2 do
	vt:=sqrt(vk+2);
	print(" ^2 -sq2[-1] ",i,vt,mods(vt,n),mods(vk,n),mods(vt^2,n),
	"== 2, ",mods(vt^2-vk,n));
	vk:=vt;
end_for;
s1:=mods(3*sq2/2,n);
print(" + ",i,mods(s1,n),mods(vk,n),mods(s1^2-vk,n));

for i from 1 to n0+1 do
	print(" x -> x^2-2 ",i,gcd(s1,n),s1);
	s1:=mods(s1^2-2,n);
end_for;
quit;
mpenguin is offline   Reply With Quote