login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A361546
a(n) is the least odd number k such that k*2^prime(n) + 1 is prime, or -1 if no such number k exists.
1
1, 5, 3, 5, 9, 5, 9, 11, 45, 23, 35, 15, 3, 9, 27, 51, 27, 53, 9, 39, 23, 249, 51, 51, 131, 221, 29, 105, 321, 179, 5, 221, 111, 411, 191, 65, 83, 75, 95, 101, 147, 83, 149, 111, 203, 131, 9, 245, 281, 15, 83, 65, 299, 39, 51, 51, 225, 65, 81, 125, 611, 143, 65, 107, 21
OFFSET
1,2
LINKS
EXAMPLE
prime(1) = 2 and 1*2^2 + 1 = 5 is prime, and no lesser odd k satisfies this, so a(1) = 1.
MATHEMATICA
a[n_] := Module[{m = 2^Prime[n], k = 1}, While[!PrimeQ[k*m + 1], k += 2]; k]; Array[a, 65] (* Amiram Eldar, Mar 15 2023 *)
PROG
(PARI) a(n)=my(m=2^prime(n), k=1); while(!isprime(k*m+1), k+=2); k
CROSSREFS
Cf. A076336. Essentially the same as A253398.
Sequence in context: A185046 A114740 A330523 * A128008 A265800 A144386
KEYWORD
nonn
AUTHOR
Jean-Marc Rebert, Mar 15 2023
STATUS
approved