Exemple #1
0
def run(upperbound):    
    result = 0; #Sum of even-valued elements.
    for n in eulermath.fibonacci(1, 2):        
        #if is even add it to result.
        if(n % 2 == 0):
            result += n;
        
        if(n > upperbound):
            break;

    #Report Completion.
    eulersupport.write_output(result);
Exemple #2
0
def run(upperbound):
    size  = 0; #How many digits the element has.
    index = 0; #Index of the target number in the fibonacci sequence.

    for n in eulermath.fibonacci(1, 1):
        size   = len(str(n));  
        index += 1;

        if(size == upperbound):
            break;

    #Report completion.
    eulersupport.write_output(index);
def run(upperbound):
    result = 0
    #Sum of even-valued elements.
    for n in eulermath.fibonacci(1, 2):
        #if is even add it to result.
        if (n % 2 == 0):
            result += n

        if (n > upperbound):
            break

    #Report Completion.
    eulersupport.write_output(result)
def run(upperbound):
    size = 0
    #How many digits the element has.
    index = 0
    #Index of the target number in the fibonacci sequence.

    for n in eulermath.fibonacci(1, 1):
        size = len(str(n))
        index += 1

        if (size == upperbound):
            break

    #Report completion.
    eulersupport.write_output(index)