proposed
approved
proposed
approved
editing
proposed
(PARI) a(n) = if (n%2, if (isprime(2*n+1), 2, -1), my(p=2); while(!isprime(p*n+1), p = nextprime(p+1)); p); \\ Michel Marcus, Sep 29 2024
proposed
editing
editing
proposed
a(1) = 2 because 2 is the smallest prime p such that 21*p+1 is prime.
proposed
editing
editing
proposed
allocated for Jean-Marc Rebert
Least prime p such that p*n+1 is prime, or -1 if no such prime exists.
2, 2, 2, 3, 2, 2, -1, 2, 2, 3, 2, 3, -1, 2, 2, 7, -1, 2, -1, 2, 2, 3, 2, 3, -1, 2, -1, 7, 2, 2, -1, 3, 2, 3, 2, 2, -1, 5, 2, 7, 2, 3, -1, 2, -1, 3, -1, 2, -1, 2, 2, 3, 2, 2, -1, 2, -1, 19, -1, 3, -1, 5, 2, 3, 2, 3, -1, 2, 2, 3, -1, 13, -1, 2, 2, 3, -1, 2, -1, 3, 2, 19
1,1
a(1) = 2 because 2 is the smallest prime p such that 2*p+1 is prime.
allocated
sign
Jean-Marc Rebert, Sep 29 2024
approved
editing
allocated for Jean-Marc Rebert
allocated
approved