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!)
A214498 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, 12, 78, 18, 18, 141, 18, 54, 78, 132, 138, 78, 57, 537, 237, 6, 972, 219, 81, 3369, 69, 501, 2328, 18, 738, 291, 393, 969, 324, 492, 102, 3291, 1788, 1401, 891, 954, 4017, 309, 702, 1656, 3999, 1014, 2346, 4008, 3, 5001, 2736, 558, 2262, 969, 762 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Conjecture : there is always one such k for each n>0.
Heuristically, the average of a(n)/n^2 over n=1 to N tends to 1.2 as N increases.
LINKS
MAPLE
A214498 := 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: # R. J. Mathar, Jul 23 2012
MATHEMATICA
sk[n_]:=Module[{n3=3^n, n2=2^n, k=0}, While[!And@@PrimeQ[(n3+k)n2+{1, -1}], k++]; k]; Array[sk, 60] (* Harvey P. Dale, Jul 23 2013 *)
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, 0
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: A329583 A050132 A320038 * A128756 A345056 A049784
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 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)