def run(upperbound): s = 0; #Sum of all amicable numbers. for i in xrange(1, upperbound +1): # print i; if(eulermath.is_amicable(i)): eulersupport.log(i, "is amicable."); s += i; #Report completion. eulersupport.write_output(s);
def run(upperbound): s = 0 #Sum of all amicable numbers. for i in xrange(1, upperbound + 1): # print i; if (eulermath.is_amicable(i)): eulersupport.log(i, "is amicable.") s += i #Report completion. eulersupport.write_output(s)
def run(upperbound): result = 0; i = 1; while(True): n = eulermath.triangle_number(i); count = eulermath.factors_count(n); eulersupport.log(n, count); if(count > upperbound): result = n; break; i += 1; #Report Completion. eulersupport.write_output(result);