def countPrimes(a, b): count = 0 for n in eulermath.infinite_range(0): possible_prime = (n * n) + (a * n) + b if (eulermath.PrimesHelper().is_prime(possible_prime)): count += 1 else: return count
def run(): result = -1 for i in eulermath.infinite_range(9, 2): if (not f(i)): result = i break print result #Report Completion. eulersupport.write_output(result)
def run(): result = -1; for i in eulermath.infinite_range(9, 2): if(not f(i)): result = i; break; print result; #Report Completion. eulersupport.write_output(result);
def run(): for j in eulermath.infinite_range(1): Pj = eulermath.pentagonal_number(j) for k in xrange(1, j): Pk = eulermath.pentagonal_number(k) s = Pj + Pk d = Pj - Pk if eulermath.is_pentagonal_number(s) and eulermath.is_pentagonal_number(d): eulersupport.write_output(d) return
def run(): for j in eulermath.infinite_range(1): Pj = eulermath.pentagonal_number(j); for k in xrange(1, j): Pk = eulermath.pentagonal_number(k); s = Pj + Pk; d = Pj - Pk; if(eulermath.is_pentagonal_number(s) and eulermath.is_pentagonal_number(d)): eulersupport.write_output(d); return;
def run(): factors_count = 4 consecutive_count = 4 consecutive_list = [] result = None for i in eulermath.infinite_range(0): print i factors = eulermath.prime_factors(i) if (len(factors) == factors_count): consecutive_list.append(i) else: consecutive_list = [] if (len(consecutive_list) == consecutive_count): result = consecutive_list[0] break eulersupport.write_output(result)