Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Created November 3, 2021 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergiolucero/c342a316648e9891182561fc7ff779b0 to your computer and use it in GitHub Desktop.
Save sergiolucero/c342a316648e9891182561fc7ff779b0 to your computer and use it in GitHub Desktop.
first 20 million p-sums
import time
t0=time.time()
psum=[(p,sum(pow(ix,-p) for ix in range(1,1000000))) for p in range(2,20)]
print(psum, time.time()-t0) # on my HP (2-20)x1M takes 4.5s
@sergiolucero
Copy link
Author

image

@sergiolucero
Copy link
Author

Time is half on the Macbook Pro (bench with hardware shot).

import platform
platform.processor()
'Intel64 Family 6 Model 158 Stepping 10, GenuineIntel'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment