OFFSET
2,2
COMMENTS
Conjecture: there is only one zero term: a(5) = 0.
The PFGW script computes 2*a(n).
LINKS
Pierre CAMI, Table of n, a(n) for n = 2..400
EXAMPLE
6^2 - 2*1*3^2 - 1 = 17, 17 and 19 twin primes so a(2)=1.
6^3 - 2*2*3^3 - 1 = 107, 107 and 109 twin primes so a(3)=2.
6^4 - 2*3*3^4 - 1 = 809, 809 and 811 twin primes so a(4)=3.
6^5 - 2*k*3^5 - 1 and 6^5 - 2*k*3^5 + 1 for k=1 to 30 have no twin prime solution so a(5)=0.
MATHEMATICA
Table[k = 0; While[k++; p = 6^n - 2*k*3^n - 1; p > 0 && ! (PrimeQ[p] && PrimeQ[p + 2])]; If[p <= 0, 0, k], {n, 2, 50}] (* T. D. Noe, Mar 15 2013 *)
PROG
(PFGW & Scriptify)
PFGW64 -lout.txt -f in.txt
in.txt file :
SCRIPT
DIM k
DIM n, 1
DIMS t
LABEL loop1
SET n, n+1
IF n>400 THEN END
SET k, 0
LABEL loop2
SET k, k+2
SETS t, %d, %d\,; n; k
PRP 6^n-k*3^n-1, t
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
SETS t, %d, %d\,; n; k
PRP 6^n-k*3^n+1, t
IF ISPRP THEN GOTO loop1
GOTO loop2
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 13 2013
STATUS
approved