A078680 Smallest m > 0 such that n*2^m + 1 is prime, or 0 if no such m exists.
1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 3, 2, 1, 1, 4, 3, 1, 6, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 8, 3, 1, 2, 1, 1, 2, 5, 1, 4, 1, 3, 2, 1, 2, 8, 583, 1, 2, 1, 1, 6, 1, 1, 4, 1, 2, 2, 5, 2, 4, 7, 1, 2, 1, 5, 2, 1, 1, 2, 3, 3, 2, 1, 1, 4, 3, 1, 2, 3, 1, 10, 1, 2, 4, 1, 2, 2, 1, 1, 8, 7, 2, 582, 1, 1, 2, 1, 1, 2, 3, 2
Offset: 1
Keywords
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
- N. J. A. Sloane, A Nasty Surprise in a Sequence and Other OEIS Stories, Experimental Mathematics Seminar, Rutgers University, Oct 10 2024, Youtube video; Slides [Mentions this sequence]
- Eric Weisstein's World of Mathematics, Sierpiński Number of the Second Kind
Programs
-
Maple
A078680 := proc(n) for m from 1 do if isprime(n*2^m+1) then return m; end if; end do: end proc: seq(A078680(n),n=1..30) ; # R. J. Mathar, Feb 25 2011
-
Mathematica
Table[m=1; While[! PrimeQ[n*2^m+1], m++]; m, {n, 100}] (* T. D. Noe, Feb 25 2011 *)
-
PARI
a(n)=if(n<0, 0, m=1; while(isprime(n*2^m+1)==0, m++); m)
Formula
If a(n) = 0, then a(2n) is also 0. If a(n) = m with m > 1, then a(2n) = m-1. - Jeppe Stig Nielsen, Feb 12 2023
Extensions
Offset corrected by Jaroslav Krizek, Feb 13 2011
Comments