Ask Your Question

Jenny123's profile - activity

2020-05-21 13:06:42 +0200 received badge  Editor (source)
2020-05-19 21:17:15 +0200 asked a question Find quadratic polynomial such that f(x)=x^2+ax+b is prime

a. Find quadratic polynomial f(x)=x²+ax+b , a,b ∈ℤ such that f(x) is prime for 1≤n≤40

I know that the polynomial f(x)=x²-x+41 takes prime values for all 1≤n≤40. But how can I find this polynomial with sage?

b. Find k (as large as possible) and quadratic polynomial such that f(x)=x²+ax+b (a,b ∈ℤ) is prime for 1≤n≤k

I only find can b if I know a. But how can I find both?

P=Primes();
for b in range (0,1000000):
     success=true;
     for x in range (1,41): 
          if not (x^2-x+b) in P:
               success=false;
               break;
     if success:
         print b;
2020-05-19 21:17:15 +0200 asked a question Find quadratic polynomial f(x)=x^2+a*x+b such that f(x) is prime

a. Find quadratic polynomial f(x)=x²+ax+b , a,b ∈ℤ such that f(x) is prime for 1≤n≤40

I know that the polynomial f(x)=x²-x+41 takes prime values for all 1≤n≤40. But how can I find this polynomial with sage?

b. Find k (as large as possible) and quadratic polynomial such that f(x)=x²+ax+b (a,b ∈ℤ) is prime for 1≤n≤k