login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A214497 Smallest k>=0 such that (3^n-k)*2^n-1 and (3^n-k)*2^n+1 are a twin prime pair. 4
0, 6, 3, 9, 9, 6, 3, 93, 3, 54, 18, 96, 213, 297, 1206, 258, 312, 201, 261, 1206, 1158, 396, 1062, 216, 708, 762, 816, 678, 3579, 762, 831, 2106, 4734, 576, 333, 633, 213, 2766, 363, 2454, 1464, 2007, 4551, 3183, 1497, 4899, 198, 66, 9984, 2847, 276, 3051 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Conjecture : there is always one such k for each n>0.
As N increases, the average of a(n)/n^2 over n=1 to N appears to approach 1.1
LINKS
MAPLE
A214497 := proc(n)
local k;
for k from 0 do
p := (3^n-k)*2^n-1 ;
if isprime(p) and isprime(p+2) then
return k;
end if;
end do:
end proc:
seq(A214497(n), n=1..80) ; # R. J. Mathar, Jul 23 2012
MATHEMATICA
sk[n_]:=Module[{k=0, c}, c=(3^n-k)2^n; While[!PrimeQ[c-1] || !PrimeQ[c+1], k++; c=(3^n-k)2^n]; k]; Array[sk, 60] (* Harvey P. Dale, Dec 09 2012 *)
PROG
(PFGW64 and SCRIPTIFY)
SCRIPT
DIM nn, 0
DIM kk
DIM jj
DIMS tt
OPENFILEOUT myfile, a(n).txt
OPENFILEOUT myf, b(n).txt
LABEL loopn
SET nn, nn+1
SET jj, 0
IF nn>500 THEN END
SET kk, -1
LABEL loopk
SET kk, kk+1
SETS tt, %d, %d\,; nn; kk
PRP (3^nn-kk)*2^nn-1, tt
IF ISPRP THEN GOTO a
IF ISPRIME THEN GOTO a
GOTO loopk
LABEL a
SET jj, jj+1
PRP (3^nn-kk)*2^nn+1, tt
IF ISPRP THEN GOTO d
IF ISPRIME THEN GOTO d
GOTO loopk
LABEL d
WRITE myfile, tt
SETS tt, %d, %d\,; nn; jj
WRITE myf, tt
GOTO loopn
CROSSREFS
Sequence in context: A180596 A154465 A176533 * A177015 A355971 A327000
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 20 2012
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 19:24 EDT 2024. Contains 371962 sequences. (Running on oeis4.)