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.

A291438 Smallest prime of the form (2*n)*3^m + 1 for some m >= 0, or -1 if no such prime exists.

Original entry on oeis.org

3, 5, 7, 73, 11, 13, 43, 17, 19, 61, 23, 73, 79, 29, 31, 97, 103, 37, 3079, 41, 43, 397, 47, 433, 151, 53, 163, 1102249, 59, 61, 5023, 193, 67, 613, 71, 73, 223, 229, 79, 241, 83, 757, 6967, 89, 271, 277, 283, 97, 883, 101, 103, 313, 107, 109, 331, 113, 3079
Offset: 1

Views

Author

Martin Renner, Aug 23 2017

Keywords

Comments

There exist even integers 2*n such that (2*n)*3^m + 1 is always composite.
It is conjectured that the smallest one is 125050976086 = A123159(3), therefore a(62525488043) = -1.
For the corresponding numbers m see A291437.

Examples

			a(4) = 73 because 8*3^2 + 1 = 73 is the smallest prime of this form, since 8*3^0 + 1 = 9 and 8*3^1 + 1 = 25 are not prime.
		

Crossrefs

Programs

  • Maple
    a:=[]:
    for n from 1 to 10^3 do
      t:=-1:
      for m from 0 to 10^3 do # this max value of m is sufficient up to n=10^3
        if isprime((2*n)*3^m+1) then t:=m: break: fi:
      od:
      a:=[op(a),(2*n)*3^t+1]:
    od:
    a;
  • Mathematica
    Table[If[# < 0, #, 1 + 2 n*3^#] &@ SelectFirst[Range[0, 10^3], PrimeQ[2 n*3^# + 1] &] /. k_ /; MissingQ@ k -> -1, {n, 60}] (* Michael De Vlieger, Aug 23 2017 *)
  • PARI
    a(n) = {my(m = 0); while (!isprime(p=(2*n)*3^m + 1), m++); p;} \\ Michel Marcus, Aug 25 2017

A345698 Sierpiński problem in base 5: a(n) is the smallest k >= 0 such that (2*n)*5^k + 1 is prime, or -1 if no such k exists.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 2, 1, 0, 0, 3, 8, 0, 1, 0, 0, 3, 0, 1, 1, 0, 1, 1, 0, 0, 1, 2, 0, 3, 0, 0, 257, 2, 0, 1, 0, 1, 1, 0, 2, 1, 2, 0, 1, 0, 0, 1, 0, 0, 3, 0, 1, 15, 4, 1, 79, 48, 0, 1, 0, 1, 5, 0, 0, 1, 6, 4, 3, 0, 0, 1, 2, 0, 3, 2, 0, 1, 0, 2, 7
Offset: 1

Views

Author

Felix Fröhlich, Jun 24 2021

Keywords

Comments

a(159986/2) = a(79993) = -1.

Examples

			For n = 17: 34*5^k + 1 is composite for k = 0, 1, 2, 3, 4, 5, 6, 7 and prime for k = 8. Since 8 is the smallest such k, a(17) = 8.
		

Crossrefs

Cf. A123159, A291437 (Sierpiński problem base 3), A345403 (Riesel problem base 5).

Programs

  • PARI
    a(n) = for(k=0, oo, if(ispseudoprime((2*n)*5^k+1), return(k)))
Showing 1-2 of 2 results.