cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Jean-Marc Rebert, Mar 15 2023

Keywords

Examples

			prime(1) = 2 and 1*2^2 + 1 = 5 is prime, and no lesser odd k satisfies this, so a(1) = 1.
		

Crossrefs

Cf. A076336. Essentially the same as A253398.

Programs

  • 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 *)
  • PARI
    a(n)=my(m=2^prime(n),k=1);while(!isprime(k*m+1),k+=2);k