Here's the example programme to illustrate the strange property of d(x). Thanks to GeSHi Filter for the syntax highlighting.
#!/usr/bin/python """ >>> print d(1) 1 >>> print d(2) 2 >>> print d(3) 6 >>> print d(4) 12 >>> print d(5) 60 >>> print d(6) 60 >>> get_ratio(10) 1.2768107627908574 >>> get_ratio(100) 1.0633172317981949 >>> get_ratio(200) 0.97018685255328507 >>> get_ratio(300) 1.0025654465340426 >>> get_ratio(400) 1.0054524536976457 >>> get_ratio(500) 0.99670664870153203 >>> get_ratio(700) 1.0014245028740023 """ import gmpy import math def d(x): """ Return the smallest positive integer number which can be exactly divded by all integers from 1 to x. """ if x == 1: return 1 dxmo = d(x - 1) gcd = gmpy.gcd(x, dxmo) if gcd == 1: return dxmo * x else: return dxmo * (x / gcd) def get_ratio(x): """ Return the ratio of x to ln d(x) """ return x / math.log(d(x)) def _test(): import doctest doctest.testmod() if __name__ == "__main__": _test()
Comments
v
旗袍是中国古老青花瓷瓶里开出的一朵郁金香,是上帝赐给中国女人的绝佳礼品;
旗袍美女,风姿卓越,贤淑典雅,娇媚迷人,配得上每一词的称赞;
唐装是时尚与经典的碰撞,是传统和现代的结合品,唐装汉服是时尚舞台永不褪色的主角;
唐思影-专业从事唐装批发,旗袍批发,长期销售旗袍,唐装,结婚旗袍,新娘旗袍,男士唐装, 女士唐装, 儿童唐装,唐装棉袄,中式服装, 唐装汉服,新颖的款式,一流细致的做工,一款款唯美,古韵悠长的唐装、旗袍,畅销海内外:http://www.tsying.com.cn
ASs
Thank you very much for this useful article. I like it.
sohbetsohbet
cinsel sohbetcinsel sohbet
sicak sohbetsıcak sohbet
cinsel sohbet
sex sohbet
güzel kızlar
sohbet
Thank you very much for this useful article. I like it.
chatchat
kelebekkelebek
kelebek sohbetkelebek sohbet
sohbetsohbet
sohbet kanallarısohbet kanalları
chat odasıchat odası
kelebek chatkelebek chat
kelebek scriptkelebek script
chatchat
thanks...
casino online online casino roulette play roulette online online casino deposit bonus online craps casino online video slot slot machines online blackjack online casino play blackjack online casinos slot machines deposit casino bonuses online casinos for usa players online casinos for money bonus usa casino online online video poker video poker machines online poker videos online baccarat best online baccarat online casino keno online keno casino