cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A076806 Minimal odd k such that k*2^n-1 and k*2^n+1 are twin primes.

This page as a plain text file.
%I A076806 #32 Sep 09 2023 06:48:49
%S A076806 3,1,9,15,81,3,9,57,45,15,99,165,369,45,345,117,381,3,69,447,81,33,
%T A076806 1179,243,765,375,81,387,45,345,681,585,375,267,741,213,429,3093,165,
%U A076806 267,255,1095,9,147,849,405,1491,177,1941,927,1125,1197,2001,333,519
%N A076806 Minimal odd k such that k*2^n-1 and k*2^n+1 are twin primes.
%H A076806 David A. Corneth, <a href="/A076806/b076806.txt">Table of n, a(n) for n = 1..16999</a> (first 200 terms from Harvey P. Dale, terms extracted from rieselprime link)
%H A076806 A. V. Kulsha, <a href="http://groups.yahoo.com/group/primenumbers/message/9836">k*2^n-1 and k*2^n+1 are twins</a>, provides terms for n<=1000.
%H A076806 Andrey Kulsha and others, <a href="/A076806/a076806.txt">k*2^n-1 and k*2^n+1 are twins</a>, digest of  15 messages in primenumbers Yahoo group, Nov 18, 2002 - May 23, 2005.
%H A076806 Author?, <a href="http://www.rieselprime.de/Related/FirstKTwin.htm">First odd k for which k*2^n-1 k*2^n+1 are twins</a>, provides terms for n<=17000.
%e A076806 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.
%t A076806 f[n_] := Block[{k = 1}, While[ !PrimeQ[k*2^n - 1] || !PrimeQ[k*2^n + 1], k += 2]; k]; Array[f, 50]
%t A076806 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 *)
%o A076806 (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)))
%o A076806 (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
%o A076806 (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
%Y A076806 Cf. A063983.
%K A076806 nonn
%O A076806 1,1
%A A076806 _Andrey V. Kulsha_, Nov 18 2002