OFFSET
1,2
COMMENTS
All the numbers in this sequence, excluding a(1), are even.
EXAMPLE
1*3^2-1 = 8 is not prime. 2*3^2-1 = 17 is prime. Thus, a(2) = 2.
1*3^5-1 = 242 is not prime. 2*3^5-1 = 485 is not prime. 3*3^5-1 = 728 is not prime. 4*3^5-1 = 971 is prime. Thus, a(5) = 4.
PROG
(Python)
import sympy
from sympy import isprime
def Pow_3(n):
..for k in range(10**4):
....if isprime(k*(3**n)-1):
......return n
n = 1
while n < 100:
..print(Pow_3(n))
..n += 1
(PARI)
for(n=1, 100, k=0; while(!isprime(k*3^n-1), k++); print1(k, ", ")) \\ Colin Barker, Mar 24 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Mar 23 2014
STATUS
approved