<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><H2 style="MARGIN: auto 0in"><SPAN style="COLOR: black"><FONT size=2>Dear sir/maddam</FONT></SPAN></H2>
<H2 style="MARGIN: auto 0in"><SPAN style="COLOR: black"><FONT size=2>I am using python Release 2.3.3, but I cant use it solving the following python source code. Would you please help me in solving the following problem using some other python release.</FONT></SPAN></H2>
<H2 style="MARGIN: auto 0in"><SPAN style="COLOR: black"><FONT size=2>Exponentiation<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></H2>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3>Consider the following Python code: <o:p></o:p></FONT></SPAN></DIV><PRE><SPAN style="COLOR: black">def expo(s,lm,N):<o:p></o:p></SPAN></PRE><PRE><SPAN style="COLOR: black"><SPAN style="mso-spacerun: yes"> </SPAN>return reduce(lambda x,m: pow(x,m,N),lm,s)<o:p></o:p></SPAN></PRE><PRE><SPAN style="COLOR: black"><o:p> </o:p></SPAN><SPAN style="COLOR: black">def hamming(a):<o:p></o:p></SPAN></PRE><PRE><SPAN style="COLOR: black"><SPAN style="mso-spacerun: yes"> </SPAN>return a>0 and (a%2)+hamming(a/2) or 0<o:p></o:p></SPAN></PRE><PRE><SPAN style="COLOR: black"><o:p> </o:p></SPAN><SPAN lang=NL-BE style="COLOR: black; mso-ansi-language: NL-BE">def htot(k):<o:p></o:p></SPAN></PRE><PRE><SPAN lang=NL-BE style="COLOR: black; mso-ansi-language: NL-BE"><SPAN style="mso-spacerun: yes">
</SPAN>n=pow(2,k)<o:p></o:p></SPAN></PRE><PRE><SPAN lang=NL-BE style="COLOR: black; mso-ansi-language: NL-BE"><SPAN style="mso-spacerun: yes"> </SPAN></SPAN><SPAN style="COLOR: black">N=pow(2,n)-3<o:p></o:p></SPAN></PRE><PRE><SPAN style="COLOR: black"><SPAN style="mso-spacerun: yes"> </SPAN>lm=[pow(i,i,N) for i in range(1,n+1)]<o:p></o:p></SPAN></PRE><PRE><SPAN style="COLOR: black"><SPAN style="mso-spacerun: yes"> </SPAN>lz=[expo(3,lm[:j]+lm[j+1:],N) for j in range(n)]<o:p></o:p></SPAN></PRE><PRE><SPAN style="COLOR: black"><SPAN style="mso-spacerun: yes"> </SPAN>return sum([hamming(z) for z in lz])<o:p></o:p></SPAN></PRE>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3>The function htot gives the following result for small values of k: <o:p></o:p></FONT></SPAN></DIV><PRE><SPAN style="COLOR: black">>>><SPAN style="mso-spacerun: yes"> </SPAN>[htot(i) for i in range(3,8)]<o:p></o:p></SPAN></PRE><PRE><SPAN style="COLOR: black">[35, 122L, 540L, 2068L, 8070L]<o:p></o:p></SPAN></PRE>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3>You are scincerely asked to compute the value of function htot for larger values of k. Go as far as you can. </FONT></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3>I am expecting your fast respond.</FONT></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3></FONT></SPAN> </DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3></FONT></SPAN> </DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3>With Best Regards.</FONT></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3></FONT></SPAN> </DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3></FONT></SPAN> </DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3>Kalkidan Aweke</FONT></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3>+251911505062</FONT></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3>Addis Ababa</FONT></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: black; FONT-FAMILY: Arial"><FONT size=3>Ethiopia<o:p></o:p></FONT></SPAN></DIV></td></tr></table><br>