A178948 a(n) = smallest m>=0 such that n*(3^m)-1 is prime, or -1 if no such prime exists.
1, 1, 0, 0, -1, 0, -1, 0, -1, 1, -1, 0, -1, 0, -1, 1, -1, 0, -1, 0, -1, 2, -1, 0, -1, 2, -1, 1, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 2, -1, 0, -1, 0, -1, 1, -1, 0, -1, 1, -1, 2, -1, 0, -1, 1, -1, 1, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 3, -1, 0, -1, 0, -1, 1, -1, 1, -1, 0, -1, 3, -1, 0, -1, 1, -1, 1, -1, 0
Offset: 1
Keywords
Examples
a(1) = 1 because 1*(3^1) - 1 = 2 is prime. a(5) = -1 because 5*(3^m) - 1 is even and >=4. a(22) = 2 because 22*(3^2)-1 = 197 is prime.
Comments