示例#1
0
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);
示例#2
0
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)
示例#3
0
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);