#!/bin/env python
# Paul Wiegmans
# 20080815

# benchmark gebaseerd op Project Euler probleem 10
# Prestaties: 
# [hostnaam] mark type, processor, OS: index
# [BPW03306] HP DCF7800SFF, Core2Duo E6550 @ 2.33 GHz, WinXP : 633
# [CERES]  ASUS eeePC 4G surf 701 , Celeron M @ 900MHz, Linux : 120
# [Rons eeePC] ASUS eeePC 900, Celeron M @ 900 MHz, Linux: 183
# [ATLAS] Via VB6000, Celeron M @ 1500 MHz, Linux: 338
# [AMBER] HP DL380, Xeon dual core @ 2,8 GHz, Linux : 278
# [BPMINS01] HP ML370, Xeon dual core @ 2,8 GHz, Linux : 301
# [JUPITER] Pauls desktop, P4 @ 2,8 GHz, WinXP : 372

import time
ti = time.time()

def main():
    maxzeef =2000000
    zeef = [1 for i in range(maxzeef)]
    for i in range(2, maxzeef):
        if zeef[i] == 1:
            for j in range(i*2, maxzeef, i):
                zeef[j] = 0
    som = 0
    for i in range(2, maxzeef):
        if zeef[i] == 1:
            som += i
    print som
 
 
main()
tijd = time.time() - ti
print "Tijd:", tijd
print "Prestatieindex:", int(1000/tijd)
# ================

