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!)
A329736 Smallest odd prime P such that P*3*2^n - 1 and P*3*2^n + 1 are twin primes. 2
3, 5, 3, 5, 43, 11, 3, 19, 17, 5, 113, 59, 317, 331, 307, 241, 127, 829, 23, 149, 127, 11, 3023, 1091, 787, 971, 1523, 2741, 727, 1051, 227, 211, 727, 89, 1163, 71, 367, 1031, 577, 89, 1213, 1151, 3, 1021, 283, 2699, 4933, 59, 647, 709, 3083, 541, 1483, 2069 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
3*3*2^1 - 1 = 17, 17 and 19 are twin primes so a(1)=3.
5*3*2^2 - 1 = 59, 59 and 61 are twin primes so a(2)=5.
3*3*2^3 - 1 = 71, 71 and 73 are twin primes so a(3)=3.
5*3*2^4 - 1 = 119, 119 and 121 are twin primes so a(4)=5.
MATHEMATICA
Array[Block[{p = 3}, While[! AllTrue[3 p*2^# + {-1, 1}, PrimeQ], p = NextPrime@ p]; p] &, 54] (* Michael De Vlieger, Nov 21 2019 *)
PROG
(PFGW Script)
SCRIPT
DIM i
DIM j
DIM n, 0
OPENFILEOUT myf, a(n).txt
LABEL loop1
SET n, n+1
IF n>500 THEN END
SET i, 1
LABEL loop2
SET i, i+1
SET j, p(i)
PRP j*3*2^n-1, n
IF ISPRP THEN GOTO a
GOTO loop2
LABEL a
PRP j*3*2^n+1, n
IF ISPRP THEN GOTO b
GOTO loop2
LABEL b
WRITE myf, j
GOTO loop1
(PARI) for(n=1, 54, my(m=3*2^n); forprime(k=3, oo, my(j=k*m); if(ispseudoprime(j-1)&&ispseudoprime(j+1), print1(k, ", "); break))) \\ Hugo Pfoertner, Nov 21 2019
(PARI) a(n) = my(p=3, q); while (!isprime(q=p*3*2^n - 1) || !isprime(q+2), p = nextprime(p+1)); p; \\ Michel Marcus, May 06 2020
CROSSREFS
Sequence in context: A151568 A134429 A100667 * A324086 A286108 A096438
KEYWORD
nonn
AUTHOR
Pierre CAMI, Nov 20 2019
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 25 05:56 EDT 2024. Contains 371964 sequences. (Running on oeis4.)