A253176 Least k>=0 such that both 3n*2^k+1 and 3n*2^k-1 are primes, or -1 if no such k exists.
1, 0, 1, 0, 1, 0, 1, 3, 2, 0, 6, 1, 3, 0, 2, 2, 1, 1, 2, 0, 14, 5, 1, 0, 1, 2, 5, 5, 2, 1, 4, 1, 1, 0, 2, 0
Offset: 1
Examples
a(11) = 6 since 33*2^n+1 and 33*2^n-1 are not both primes for all 0 <= n <= 5, but they are both primes for n = 6.
Links
- Ray Ballinger and Wilfrid Keller, Primes of the form k*2^n+1 for k up to 300
- Ray Ballinger and Wilfrid Keller, Primes of the form k*2^n-1 for k up to 300
- Eric Chen, Table of n, a(n) for n = 1..1000 (-1 if this term is unknown or does not exist)
- Carlos Rivera, Problem 49. Sierpinski-like numbers
Programs
-
Mathematica
Table[k = 0; While[! PrimeQ[3*n*2^k + 1] || ! PrimeQ[3*n*2^k - 1], k++]; k, {n, 60}]
-
PARI
a(n) = for(k=0, 2^24, if(ispseudoprime(3*n*2^k+1) && ispseudoprime(3*n*2^k-1), return(k)))
Formula
If a(n) > 0, then a(2n) = a(n) - 1.
Comments