login
A371896
a(n) is the length of the uninterrupted sequence of primes generated by the polynomial f(x) = x^2 + x + p for x=0,1,..., where p=A001359(n).
1
2, 4, 10, 16, 2, 40, 2, 2, 4, 3, 2, 2, 2, 3, 2, 4, 2, 2, 2, 3, 5, 2, 2, 3, 2, 2, 2, 2, 5, 2, 2, 3, 2, 3, 3, 2, 2, 2, 2, 4, 2, 2, 7, 2, 3, 2, 5, 2, 4, 4, 6, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 3, 5, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2
OFFSET
1,1
COMMENTS
p=A001359(n) is the smaller prime of a twin prime pair so that f(0) = p and f(1) = p+2 are both primes so a(n) >= 2 and this sequence is the terms >= 2 in A208936.
REFERENCES
L. Euler, Nouveaux Mémoires de l'Académie royale des Sciences, 1772, p. 36.
LINKS
EXAMPLE
For n=6, p = A001359(n) = 41 and f(x) = x^2 + x + 41 is Euler's polynomial which generates primes f(x) for x=0,1,2,...,39, which is 40 terms so a(6) = 40 (cf. A202018).
MATHEMATICA
A001359[1] = 3;
A001359[n_] := A001359[n] = (p = NextPrime[A001359[n - 1]];
While[!PrimeQ[p + 2], p = NextPrime[p]]; p)
A371896[n_] := With[{p = A001359@n}, k = 1;
While[PrimeQ[k^2 + k + p], k++]; k]
(* Leo C. Stein, May 09 2024 *)
PROG
(C++)
#include <iostream>
using namespace std;
bool isPrime(int number){
if(number < 2) return false;
if(number == 2) return true;
if(number % 2 == 0) return false;
for(int i=3; (i*i)<=number; i+=2){
if(number % i == 0) return false;
}
return true;
}
int main() {
int x;
for (int p=2; p<100000000; p++) {
if (isPrime(p)) {
x=1;
while (isPrime(x*x+x+p)) {
x++;
}
if (x>1) {
cout << x << ", ";
}
}
}
return 0;
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Rowlett, Apr 11 2024
STATUS
approved