login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A076806 Minimal odd k such that k*2^n-1 and k*2^n+1 are twin primes. 2
3, 1, 9, 15, 81, 3, 9, 57, 45, 15, 99, 165, 369, 45, 345, 117, 381, 3, 69, 447, 81, 33, 1179, 243, 765, 375, 81, 387, 45, 345, 681, 585, 375, 267, 741, 213, 429, 3093, 165, 267, 255, 1095, 9, 147, 849, 405, 1491, 177, 1941, 927, 1125, 1197, 2001, 333, 519 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

David A. Corneth, Table of n, a(n) for n = 1..16999 (first 200 terms from Harvey P. Dale, terms extracted from rieselprime link)

A. V. Kulsha, k*2^n-1 and k*2^n+1 are twins, provides terms for n<=1000.

Andrey Kulsha and others, k*2^n-1 and k*2^n+1 are twins, digest of  15 messages in primenumbers Yahoo group, Nov 18, 2002 - May 23, 2005.

Author?, First odd k for which k*2^n-1 k*2^n+1 are twins, provides terms for n<=17000.

EXAMPLE

a(4)=15 because k*2^4-1 and k*2^4+1 are twin primes for k=15 and are not twin primes for smaller odd k.

MATHEMATICA

f[n_] := Block[{k = 1}, While[ !PrimeQ[k*2^n - 1] || !PrimeQ[k*2^n + 1], k += 2]; k]; Array[f, 50]

mok[n_]:=Module[{n2=2^n, k=1}, While[!AllTrue[k*n2+{1, -1}, PrimeQ], k=k+2]; k]; Array[mok, 60] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 19 2015 *)

PROG

(PARI) for(n=1, 100, N=2^n; forstep(k=1, 10^100, 2, if(isprime(k*N-1) && isprime(k*N+1), print1(k, ", "); break)))

(Sage) A076806 = lambda n: next(k for k in IntegerRange(1, infinity, 2) if is_prime(k*2**n-1) and is_prime(k*2**n+1)) # D. S. McNeil, Dec 08 2010

(MAGMA) a:=[]; for n in [1..55] do k:=1; while not (IsPrime(k*2^n-1) and IsPrime(k*2^n+1)) do k:=k+2; end while; Append(~a, k); end for; a; // Marius A. Burtea, Nov 16 2019

CROSSREFS

Sequence in context: A162749 A094796 A056843 * A111568 A209324 A121489

Adjacent sequences:  A076803 A076804 A076805 * A076807 A076808 A076809

KEYWORD

nonn

AUTHOR

Andrey V. Kulsha, Nov 18 2002

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 July 16 14:09 EDT 2021. Contains 346065 sequences. (Running on oeis4.)