login
This site is supported by donations to The OEIS Foundation.

 

Logo


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
1, 2, 3, 0, 3, 11, 33, 9, 26, 6, 34, 138, 51, 19, 33, 246, 66, 31, 167, 73, 13, 716, 138, 148, 138, 339, 447, 41, 131, 41, 9, 178, 778, 337, 543, 2154, 213, 1216, 454, 183, 678, 442, 157, 381, 297, 1476, 54, 1201, 1942, 1566, 572, 3708, 3261, 3672, 1087, 306 (list; graph; refs; listen; history; text; internal format)
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 Sriptify

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

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

Sequence in context: A180188 A316607 A194365 * A253283 A261719 A137663

Adjacent sequences:  A216214 A216215 A216216 * A216218 A216219 A216220

KEYWORD

nonn

AUTHOR

Pierre CAMI, Mar 13 2013

STATUS

approved

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 19 19:30 EDT 2019. Contains 321330 sequences. (Running on oeis4.)