[Distutils] question about python

Kalkidan Aweke kalkidan5033 at yahoo.com
Tue Nov 18 11:36:09 CET 2008


Dear sir/maddam
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.
Exponentiation
Consider the following Python code: def expo(s,lm,N):  return reduce(lambda x,m: pow(x,m,N),lm,s) def hamming(a):  return a>0 and (a%2)+hamming(a/2) or 0 def htot(k):  n=pow(2,k)  N=pow(2,n)-3  lm=[pow(i,i,N) for i in range(1,n+1)]  lz=[expo(3,lm[:j]+lm[j+1:],N) for j in range(n)]  return sum([hamming(z) for z in lz])
The function htot gives the following result for small values of k: >>>  [htot(i) for i in range(3,8)][35, 122L, 540L, 2068L, 8070L]
You are scincerely asked to compute the value of function htot for larger values of k. Go as far as you can.  
I am expecting your fast respond.
 
 
With Best Regards.
 
 
Kalkidan Aweke
+251911505062
Addis Ababa
Ethiopia


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20081118/1a4c2003/attachment.htm>


More information about the Distutils-SIG mailing list