A343914 Riesel problem in base 3: a(n) is the smallest k >= 0 such that (2*n)*3^k-1 is prime, or -1 if no such k exists.
1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 2, 1, 0, 0, 1, 1, 0, 2, 0, 0, 1, 0, 1, 2, 0, 1, 1, 0, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 3, 0, 1, 1, 0, 2, 1, 2, 0, 3, 0, 0, 1, 0, 0, 3, 0, 1, 1, 1, 2, 3, 9, 0, 1, 0, 1, 2, 0, 0, 2, 1, 6, 1, 0, 0, 1, 1, 0, 1, 3, 0, 2, 0, 1, 3, 0
Offset: 1
Keywords
Examples
For n = 11: (2*11)*3^k-1 is prime for k = 2, with 2 being the smallest such k, so a(11) = 2.
Links
- Wikipedia, Riesel number
Programs
-
PARI
a(n) = for(k=0, oo, if(ispseudoprime((2*n)*3^k-1), return(k)))
Comments