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!)
A212038 The size of the set of numbers k>=0 such that all (2^n-k)*2^n-1 are prime but only (2^n-k)*2^n+1 with the largest k is also the associated twin prime. 1

%I #16 Jul 23 2012 17:01:50

%S 1,7,5,2,4,11,6,1,3,2,31,2,11,11,11,6,30,16,2,36,90,56,11,52,13,36,10,

%T 62,20,31,23,28,30,14,47,22,10,5,104,39,11,14,64,184,209,176,193,162,

%U 25,38,23,5,27,157,5,17,32,90,1,199,96,83,29,82,12,220,19,40,37,13,16,120,11,130,12,77,202

%N The size of the set of numbers k>=0 such that all (2^n-k)*2^n-1 are prime but only (2^n-k)*2^n+1 with the largest k is also the associated twin prime.

%C Search set similar to A212037 but the sign of k in the prime form is switched.

%C Heuristically the average of a(n)/n for n=1 to N tends to 1 as N increases.

%H Pierre CAMI, <a href="/A212038/b212038.txt">Table of n, a(n) for n = 4..825</a>

%p A212038 := proc(n)

%p local a,k,p ;

%p a := 0 ;

%p for k from 0 do

%p p := (2^n-k)*2^n-1 ;

%p if isprime(p) then

%p a := a+1 ;

%p end if;

%p if isprime(p) and isprime(p+2) then

%p return a;

%p end if;

%p end do:

%p end proc: # _R. J. Mathar_, Jul 21 2012

%o SCRIPT

%o DIM nn, 3

%o DIM jj

%o DIM kk

%o DIMS tt

%o OPENFILEOUT myfile, a(n).txt

%o LABEL loopn

%o SET nn, nn+1

%o IF nn>825 THEN END

%o SET kk, -1

%o SET jj, 0

%o LABEL loopk

%o SET kk, kk+1

%o SETS tt, %d, %d\,; nn; kk

%o PRP (2^nn-kk)*2^nn-1, tt

%o IF ISPRP THEN GOTO a

%o IF ISPRIME THEN GOTO a

%o GOTO loopk

%o LABEL a

%o SET jj, jj+1

%o PRP (2^nn-kk)*2^nn+1, tt

%o IF ISPRP THEN GOTO d

%o IF ISPRIME THEN GOTO d

%o GOTO loopk

%o LABEL d

%o SETS tt, %d, %d\,; nn; jj

%o WRITE myfile, tt

%o GOTO loopn

%Y Cf. A191619, A191620, A205322.

%K nonn

%O 4,2

%A _Pierre CAMI_, Jul 14 2012

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 10:56 EDT 2024. Contains 371791 sequences. (Running on oeis4.)