N=300000
prime_list=[]
p=3
while p<N:
prime_list.append(p)
p=next_prime(p)
goldbach_representations=[0 for i in srange(2*N)]
for p in prime_list:
for q in prime_list:
goldbach_representations[p+q]+=1
goldbach_reps_pairs=[]
for i in srange(len(goldbach_representations)/2):
if goldbach_representations[i]>0:
goldbach_reps_pairs.append([i,goldbach_representations[i]])
def hl(n):
m=Integer(2*n)
pd= m.prime_factors()
hlf=1
for p in pd[1:]:
hlf=hlf*(p-1)/(p-2)
return(hlf)
gbc= [] #goldbach corrected by hl(n)
for x in goldbach_reps_pairs:
#print(type(x[0]))
#a=x[0]
#print( hl(a) )
gbc.append([x[0],x[1]/hl(x[0])])