This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A216217 Smallest k such that 6^n - 2*k*3^n - 1 and 6^n - 2*k*3^n + 1 are twin primes or 0 if no solution, n > 1. 1

%I

%S 1,2,3,0,3,11,33,9,26,6,34,138,51,19,33,246,66,31,167,73,13,716,138,

%T 148,138,339,447,41,131,41,9,178,778,337,543,2154,213,1216,454,183,

%U 678,442,157,381,297,1476,54,1201,1942,1566,572,3708,3261,3672,1087,306

%N Smallest k such that 6^n - 2*k*3^n - 1 and 6^n - 2*k*3^n + 1 are twin primes or 0 if no solution, n > 1.

%C Conjecture: there is only one zero term: a(5) = 0.

%C The PFGW script computes 2*a(n).

%H Pierre CAMI, <a href="/A216217/b216217.txt">Table of n, a(n) for n = 2..400</a>

%e 6^2 - 2*1*3^2 - 1 = 17, 17 and 19 twin primes so a(2)=1.

%e 6^3 - 2*2*3^3 - 1 = 107, 107 and 109 twin primes so a(3)=2.

%e 6^4 - 2*3*3^4 - 1 = 809, 809 and 811 twin primes so a(4)=3.

%e 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.

%t 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 *)

%o PFGW Sriptify

%o PFGW64 -lout.txt -f in.txt

%o in.txt file :

%o SCRIPT

%o DIM k

%o DIM n,1

%o DIMS t

%o LABEL loop1

%o SET n,n+1

%o IF n>400 THEN END

%o SET k,0

%o LABEL loop2

%o SET k,k+2

%o SETS t,%d,%d\,;n;k

%o PRP 6^n-k*3^n-1,t

%o IF ISPRP THEN GOTO a

%o GOTO loop2

%o LABEL a

%o SETS t,%d,%d\,;n;k

%o PRP 6^n-k*3^n+1,t

%o IF ISPRP THEN GOTO loop1

%o GOTO loop2

%Y Cf. A205322 (similar, but powers of 2).

%K nonn

%O 2,2

%A _Pierre CAMI_, Mar 13 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified April 18 22:08 EDT 2019. Contains 322237 sequences. (Running on oeis4.)