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!)
A214495 Smallest k>0 such that (3^n-k)*3^n-1 and (3^n-k)*3^n+1 are a twin prime pair. 6
1, 1, 11, 19, 7, 1, 23, 31, 53, 49, 47, 139, 49, 101, 97, 399, 87, 281, 37, 329, 893, 497, 203, 883, 213, 1171, 633, 593, 1747, 349, 3843, 479, 2347, 329, 1921, 1299, 2933, 1467, 3097, 1943, 1509, 2077, 2111, 723, 2913, 2307, 963, 361, 297, 1249, 1031, 2153 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Conjecture : there is always one such k(n) for each n>0.
Heuristically, as N increases, the average of a(n)/n^2 over n=1 to N tends to 1.2
LINKS
MAPLE
A214495 := proc(n)
local k;
for k from 1 do
p := (3^n-k)*3^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[{k=1, n3=3^n}, While[!PrimeQ[(n3-k)*n3-1]||!PrimeQ[(n3-k)* n3+1], k++]; k]; Array[sk, 60] (* Harvey P. Dale, Sep 05 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)*3^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)*3^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
Cf. A214496.
Sequence in context: A303237 A066950 A352955 * A162011 A123248 A341899
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jul 19 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 August 23 22:08 EDT 2024. Contains 375396 sequences. (Running on oeis4.)