Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enrico@enrico-desktop:~/Documenti/py$ time (echo "370" | python stir.py ) | bc
- .0000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000010278975819208126252741806\
- 7277113454651612469596010476344027214109934877628
- real 0m0.050s
- user 0m0.044s
- sys 0m0.004s
- enrico@enrico-desktop:~/Documenti/py$ time (echo "400" | python stir.py ) | bc
- .0000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000070557735269639691607297069823223710176858294513690570241\
- 7953010303021834427544085462141056021616592478932
- real 0m0.047s
- user 0m0.044s
- sys 0m0.000s
- enrico@enrico-desktop:~/Documenti/py$ time (echo "600" | python stir.py ) | bc
- .0000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000120219848014606841559699576713234914082913173199736222553653\
- 39148644331571067113914119521280350418857110955094527669916527722318\
- 2124611979832770379908390654061427917815626485711
- real 0m0.061s
- user 0m0.052s
- sys 0m0.004s
- enrico@enrico-desktop:~/Documenti/py$ time (echo "1500" | python stir.py ) | bc
- .0000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000007880310104688594927742533297802833\
- 50019472950167445409306429047535425195303871218998213291132864459849\
- 70693566060265586825862186633526409987435025331834174787784446439030\
- 4672194620645694399383917010383083286026596052170
- real 0m0.082s
- user 0m0.072s
- sys 0m0.008s
- enrico@enrico-desktop:~/Documenti/py$ time (echo "2300" | python stir.py ) | bc
- .0000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000002042413568386406031257712197828887569\
- 90660001255663831725230494942153838025028965439023417386104818440636\
- 80940124768091789968417497362700809799379987837125684635011297612394\
- 3966884048364258486730959022430666083688754672704
- real 0m0.096s
- user 0m0.084s
- sys 0m0.008s
- enrico@enrico-desktop:~/Documenti/py$ time (echo "5000" | python stir.py ) | bc
- .0000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000003981805052007088757012195578627065322\
- 50618444153392040989938483057049993863199092848716147433631589590778\
- 65688809056671046536541000552388217855502540024882822525368944888939\
- 3339925295734966268971293100171311525356723300293
- real 0m0.187s
- user 0m0.176s
- sys 0m0.008s
- enrico@enrico-desktop:~/Documenti/py$ time (echo "10000" | python stir.py ) | bc
- .0000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000003983408516103932464167205865662666967\
- 28071413383505964434693958072924327738665285622248048344092567196814\
- 51658013472386195191400328738659752465503994167791220287314720443308\
- 9875314456467188699360490697226824126361432368926
- real 0m0.380s
- user 0m0.372s
- sys 0m0.004s
- enrico@enrico-desktop:~/Documenti/py$ time (echo "50000" | python stir.py ) | bc
- .0000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000003983408517872980549687775708738072865\
- 47206812807341138634076564803521951613759220127755735231298792340706\
- 41815368427921468226288165023061826216593384286014634834848990573149\
- 7860487733673863500450776736214257757603341726874
- real 0m3.453s
- user 0m3.440s
- sys 0m0.020s
- enrico@enrico-desktop:~/Documenti/py$ time (echo "100000" | python stir.py ) | bc
- .0000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000000000000000000000000000000000000000000\
- 00000000000000000000000000000003983408517872980549687775708738072865\
- 47206812807341138634464275105748544232731048435781211547376619594013\
- 95511793812078914119528661375598980625263147931379446102605294112506\
- 5868731796232437117811600923189641235548004412914
- real 0m10.042s
- user 0m10.009s
- sys 0m0.028s
- enrico@enrico-desktop:~/Documenti/py$ time (echo "1000000" | python stir.py ) | bc
- ^[^CTraceback (most recent call last):
- File "stir.py", line 19, in <module>
- print '(',summatory(0,k),'/',math.factorial(k),') /',k**n
- KeyboardInterrupt
- close failed in file object destructor:
- sys.excepthook is missing
- lost sys.stderr
- real 6m30.928s
- user 6m30.472s
- sys 0m0.288s
- enrico@enrico-desktop:~/Documenti/py$ cat stir.py
- import math
- global n
- global k
- n=input('# n (persone)> ')
- print n
- k=365
- def cbin(n,k):
- return math.factorial(n)/( math.factorial(k)*math.factorial(n-k) )
- def summatory(min,max):
- s = 0
- for j in range(min,max+1):
- s += ((-1)**(k-j))*cbin(k,j)*(j**n)
- return s
- print 'scale=1000'
- print '(',summatory(0,k),'/',math.factorial(k),') /',k**n
- enrico@enrico-desktop:~/Documenti/py$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement