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.

Showing 1-2 of 2 results.

A247479 Smallest odd k > 1 such that k*2^n+1 is a prime number.

Original entry on oeis.org

3, 3, 5, 7, 3, 3, 5, 3, 15, 13, 9, 3, 5, 7, 5, 21, 9, 3, 11, 7, 11, 25, 45, 45, 5, 7, 15, 13, 23, 3, 35, 43, 9, 75, 59, 3, 15, 15, 5, 27, 3, 9, 9, 15, 35, 19, 27, 15, 23, 7, 17, 7, 51, 49, 5, 27, 29, 99, 27, 31, 53, 105, 9, 25, 9, 3, 9, 31, 23
Offset: 1

Views

Author

Pierre CAMI, Dec 01 2014

Keywords

Comments

Differs from A057778 only where n is related to a Fermat prime (A019434). - R. J. Mathar, Dec 02 2014
Records: 3, 5, 7, 15, 21, 25, 45, 75, 99, 105, 127, 249, 321, 363, 411, 421, 535, 823, 1383, 1875, 2375, 2443, 2865, 4063, 4141, 4239, 4623, 5175, 5469, 14319, 15979, 17817, 25925, 30487, 39741, 48055, 49709, 50721, 55367, ... . - Robert G. Wilson v, Feb 02 2015

Crossrefs

Programs

  • Maple
    A247479:= proc(n) local k;
          for k from 3 by 2 do if isprime(k*2^n+1) then return k fi od
       end proc:
    seq(A247479(n),n=1..100); # Robert Israel, Dec 01 2014
  • Mathematica
    f[n_] := Block[{k = 3, p = 2^n}, While[ !PrimeQ[k*p + 1], k += 2]; k]; Array[f, 70] (* Robert G. Wilson v, Jan 29 2015 *)
  • PARI
    a(n) = {k = 3; while (! isprime(k*2^n+1), k += 2); k;} \\ Michel Marcus, Dec 01 2014

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
Showing 1-2 of 2 results.